Commit f542cdfa authored by Slark Xiao's avatar Slark Xiao Committed by David S. Miller

net: wwan: Fix MRU mismatch issue which may lead to data connection lost

In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info.
This value shall be used for whole mhi if it's given a value for a specific product.
But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU.
'mru_default' shall have higher priority than MHI_DEFAULT_MRU.
And after checking, this change could help fix a data connection lost issue.

Fixes: 5c2c8531 ("bus: mhi: pci-generic: configurable network interface MRU")
Signed-off-by: default avatarShujun Wang <wsj20369@163.com>
Signed-off-by: default avatarSlark Xiao <slark_xiao@163.com>
Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 020a45af
...@@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work) ...@@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work)
int err; int err;
while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) { while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) {
struct sk_buff *skb = alloc_skb(MHI_DEFAULT_MRU, GFP_KERNEL); struct sk_buff *skb = alloc_skb(mbim->mru, GFP_KERNEL);
if (unlikely(!skb)) if (unlikely(!skb))
break; break;
err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb, err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb,
MHI_DEFAULT_MRU, MHI_EOT); mbim->mru, MHI_EOT);
if (unlikely(err)) { if (unlikely(err)) {
kfree_skb(skb); kfree_skb(skb);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment