All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Slark Xiao <slark_xiao@163.com>
Cc: loic.poulain@linaro.org, ryazanov.s.a@gmail.com,
	johannes@sipsolutions.net, quic_jhugo@quicinc.com,
	netdev@vger.kernel.org, mhi@lists.linux.dev,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable
Date: Wed, 3 Jul 2024 19:16:55 +0530	[thread overview]
Message-ID: <20240703134655.GD4342@thinkpad> (raw)
In-Reply-To: <20240701021216.17734-3-slark_xiao@163.com>

On Mon, Jul 01, 2024 at 10:12:16AM +0800, Slark Xiao wrote:
> 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)". In order
> to fix this issue, we decide to use the device name of MHI
> controller to do a match in wwan side. Then wwan driver could
> set a corresponding mux_id value according to the MHI product.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>

Applied to mhi-next with Jakub's ACK!

- Mani

> ---
> v2: Remove Fix flag
> v3: Use name match solution instead of use mux_id
> ---
>  drivers/net/wwan/mhi_wwan_mbim.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
> index 3f72ae943b29..e481ced496d8 100644
> --- a/drivers/net/wwan/mhi_wwan_mbim.c
> +++ b/drivers/net/wwan/mhi_wwan_mbim.c
> @@ -42,6 +42,8 @@
>  #define MHI_MBIM_LINK_HASH_SIZE 8
>  #define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE)
>  
> +#define WDS_BIND_MUX_DATA_PORT_MUX_ID 112
> +
>  struct mhi_mbim_link {
>  	struct mhi_mbim_context *mbim;
>  	struct net_device *ndev;
> @@ -93,6 +95,15 @@ static struct mhi_mbim_link *mhi_mbim_get_link_rcu(struct mhi_mbim_context *mbim
>  	return NULL;
>  }
>  
> +static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl)
> +{
> +	if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 ||
> +	    strcmp(cntrl->name, "foxconn-t99w515") == 0)
> +		return WDS_BIND_MUX_DATA_PORT_MUX_ID;
> +
> +	return 0;
> +}
> +
>  static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session,
>  				     u16 tx_seq)
>  {
> @@ -596,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
>  {
>  	struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
>  	struct mhi_mbim_context *mbim;
> -	int err;
> +	int err, link_id;
>  
>  	mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL);
>  	if (!mbim)
> @@ -617,8 +628,11 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
>  	/* Number of transfer descriptors determines size of the queue */
>  	mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
>  
> +	/* Get the corresponding mux_id from mhi */
> +	link_id = mhi_mbim_get_link_mux_id(cntrl);
> +
>  	/* 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, link_id);
>  }
>  
>  static void mhi_mbim_remove(struct mhi_device *mhi_dev)
> -- 
> 2.25.1
> 

-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2024-07-03 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
2024-07-01  2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
2024-07-01 15:13   ` Jeffrey Hugo
2024-07-01 16:27     ` Manivannan Sadhasivam
2024-07-02  6:36       ` Slark Xiao
2024-07-03 13:46   ` Manivannan Sadhasivam
2024-07-01  2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
2024-07-01 21:28   ` Jakub Kicinski
2024-07-03 13:46   ` Manivannan Sadhasivam [this message]
2024-07-01 16:25 ` [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Manivannan Sadhasivam
2024-07-02  6:34   ` Slark Xiao
2024-07-03 13:28     ` Manivannan Sadhasivam
2024-07-03 13:44 ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240703134655.GD4342@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=mhi@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=slark_xiao@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.