From patchwork Wed Jun 12 09:38:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slark Xiao X-Patchwork-Id: 13694704 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E72352576F; Wed, 12 Jun 2024 09:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.50.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185173; cv=none; b=umE59L7TIfUr2p8MD9WV28izq+eoBFqKzONj+EKQbgHEtJok8McXKFWSkLf0N72n5WQisvYTeUblWiGYi9Zb+PGyQmQpZhRcPcr22QTRox0zG+TIPUF6ZDCChZVPAaP0zyTCNOIKUR49UlRUNrhuwO/eKnTncPtJatDgOuwfLXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185173; c=relaxed/simple; bh=hq17MAkaqI/mS5UaroN1BkaNHRkBEIuYufisq/6rssk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=uqVl4isjzWbvZVIq7UNf/C/4gxzawqKJrlVzt6hbzr26s6N52UKBlZUrm5R1xdBuPqFGuYM4QUEGdbSmex6cdk5tU7+MZCFqYuYdL3lHwqyJZzovJ/KbJF061bKJ4oDYdC6KWl4BEp6xo0mQ31K4VKfNhW9XUcioR+FQf32ZXUk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=YkgDkpNg; arc=none smtp.client-ip=45.254.50.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="YkgDkpNg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=tAb1g 4fB79567ItBIyDcRXSQsvQ9HpG5fbNWTaEarMY=; b=YkgDkpNgD+bYwyzX+c46Z bbHYLMbEFwRAvUtfovntc83lNRnRxrL1K8/xJzIWWD26/PMNvt8DMGO21sDD5olI HY6FkO6+4wgZocB81Uhr0NbG/XpJLKRahwoZjfMtuwUVk+KtGSj/qTzoFaurKWBF h8+ldOaGjhebLDIgknMKek= Received: from localhost.localdomain (unknown [112.97.57.186]) by gzga-smtp-mta-g0-2 (Coremail) with SMTP id _____wDX30WwbGlmH_qlAQ--.27950S2; Wed, 12 Jun 2024 17:38:57 +0800 (CST) From: Slark Xiao To: manivannan.sadhasivam@linaro.org, loic.poulain@linaro.org, ryazanov.s.a@gmail.com, johannes@sipsolutions.net, quic_jhugo@quicinc.com Cc: netdev@vger.kernel.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Slark Xiao Subject: [PATCH v2 1/2] bus: mhi: host: Import mux_id item Date: Wed, 12 Jun 2024 17:38:42 +0800 Message-Id: <20240612093842.359805-1-slark_xiao@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDX30WwbGlmH_qlAQ--.27950S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7ZrWfJr1DAr1DAF1kKw13CFg_yoW8tr4kpF sYgrW3Jr4fXrWjyryqk3s7ZF1rWw4DG347KrW7K342ywn8t34qvFWjga4ftF1akrZFkF42 yFy5u3y5W3WDXFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRuc_3UUUUU= X-CM-SenderInfo: xvod2y5b0lt0i6rwjhhfrp/1tbiRxT7ZGV4JvHumQAAsx For SDX72 MBIM mode, it starts data mux id from 112 instead of 0. This would lead to device can't ping outside successfully. Also MBIM side would report "bad packet session (112)". So we add a default mux_id value for SDX72. And this value would be transferred to wwan mbim side. Signed-off-by: Slark Xiao --- drivers/bus/mhi/host/pci_generic.c | 3 +++ include/linux/mhi.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c index 0b483c7c76a1..9e9adf8320d2 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -53,6 +53,7 @@ struct mhi_pci_dev_info { unsigned int dma_data_width; unsigned int mru_default; bool sideband_wake; + unsigned int mux_id; }; #define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \ @@ -469,6 +470,7 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx72_info = { .dma_data_width = 32, .mru_default = 32768, .sideband_wake = false, + .mux_id = 112, }; static const struct mhi_channel_config mhi_mv3x_channels[] = { @@ -1035,6 +1037,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) mhi_cntrl->runtime_get = mhi_pci_runtime_get; mhi_cntrl->runtime_put = mhi_pci_runtime_put; mhi_cntrl->mru = info->mru_default; + mhi_cntrl->link_id = info->mux_id; if (info->edl_trigger) mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger; diff --git a/include/linux/mhi.h b/include/linux/mhi.h index b573f15762f8..499c735fb1a3 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -361,6 +361,7 @@ struct mhi_controller_config { * @wake_set: Device wakeup set flag * @irq_flags: irq flags passed to request_irq (optional) * @mru: the default MRU for the MHI device + * @link_id: the default link * * Fields marked as (required) need to be populated by the controller driver * before calling mhi_register_controller(). For the fields marked as (optional) @@ -445,6 +446,7 @@ struct mhi_controller { bool wake_set; unsigned long irq_flags; u32 mru; + u32 link_id; }; /** From patchwork Wed Jun 12 09:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slark Xiao X-Patchwork-Id: 13694705 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D2DD16DEBD; Wed, 12 Jun 2024 09:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.50.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185208; cv=none; b=KK1e2T10ZfB3uUFOMQzSl1wZSI/mvagvedAJNnAjI6lE1cYE5hT/ey0AJJN1BMN6dglQwuxn8cx919eb9Jh4+uL8WrUXX7X5CKqhtqPy1h565sBfoMf6clNNaZMOKTQHcNUU77yWn46/8LQDGW2U4D8+Sz3ydIZdIs8RwRxu6aU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185208; c=relaxed/simple; bh=CseckecvFHVYq5/Mi+eTnmliiolSYA/fTa5Hy15SGko=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WDLfCcTxczVXbYZyjSkZ1rv2BMlqdLiJDHU36xc9TCt0V1DsL/2Z+CbmcIiEIIJB6vOgGFkOY/eCZmJPgswCKJ/+5ov2AVXDxtB6WO4QtlJ1V0PonEjqdt93g3wP44Zc/0+1KlL8rDZzhpPX/jPBWLSYoAWQxWqRxlr5hulbq/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=kaIQcOzC; arc=none smtp.client-ip=45.254.50.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="kaIQcOzC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=dtUDZ Mf38e7mWzd9Ay3BGQ/8e3RMt1YamowsisI+xss=; b=kaIQcOzCsSj7DeZtSqF3G 3yd4ErsVsEhlYaw+DHzDVuPydojnuGCILlEnl3GCasebdo1NSqec8jrISY3Cr1t3 Tcsfdxh2xOedJConjqb4JobaBft8RuhbjAZ2+spqcaaB4xPfGJ2bPqRe4H33c+Ei 19UiCBSuBkAwgcsfBRzXrM= Received: from localhost.localdomain (unknown [112.97.57.186]) by gzga-smtp-mta-g0-4 (Coremail) with SMTP id _____wDX37ngbGlmhhrDHw--.14951S2; Wed, 12 Jun 2024 17:39:45 +0800 (CST) From: Slark Xiao To: manivannan.sadhasivam@linaro.org, loic.poulain@linaro.org, ryazanov.s.a@gmail.com, johannes@sipsolutions.net, quic_jhugo@quicinc.com Cc: netdev@vger.kernel.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Slark Xiao Subject: [PATCH v2 2/2] net: wwan: mhi: make default data link id configurable Date: Wed, 12 Jun 2024 17:39:41 +0800 Message-Id: <20240612093941.359904-1-slark_xiao@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDX37ngbGlmhhrDHw--.14951S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFWkWFy7JF4xXF1kZryUAwb_yoWktrXE9r 1kuas7WF4UWr1rKr1j9F98ZrySkwnYqFZ2gr1ft395J3sxXFy7uay5Zr1UtrnF9w47Crn7 Wr47XFyakw48WjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRNoGQDUUUUU== X-CM-SenderInfo: xvod2y5b0lt0i6rwjhhfrp/1tbiNQH7ZGV4IDQMmgAAs0 For SDX72 MBIM device, it starts data mux id from 112 instead of 0. This would lead to device can't ping outside successfully. Also MBIM side would report "bad packet session (112)". So we add a link id default value for these SDX72 products which works in MBIM mode. Signed-off-by: Slark Xiao --- drivers/net/wwan/mhi_wwan_mbim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c index 3f72ae943b29..c731fe20814f 100644 --- a/drivers/net/wwan/mhi_wwan_mbim.c +++ b/drivers/net/wwan/mhi_wwan_mbim.c @@ -618,7 +618,8 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE); /* Register wwan link ops with MHI controller representing WWAN instance */ - return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0); + return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, + mhi_dev->mhi_cntrl->link_id); } static void mhi_mbim_remove(struct mhi_device *mhi_dev)