Skip to content

Commit

Permalink
net: wwan: Fix MRU mismatch issue which may lead to data connection lost
Browse files Browse the repository at this point in the history
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: 5c2c853 ("bus: mhi: pci-generic: configurable network interface MRU")
Signed-off-by: Shujun Wang <[email protected]>
Signed-off-by: Slark Xiao <[email protected]>
Reviewed-by: Loic Poulain <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SlarkXiao authored and davem330 committed Jan 15, 2022
1 parent 020a45a commit f542cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wwan/mhi_wwan_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work)
int err;

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))
break;

err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb,
MHI_DEFAULT_MRU, MHI_EOT);
mbim->mru, MHI_EOT);
if (unlikely(err)) {
kfree_skb(skb);
break;
Expand Down

0 comments on commit f542cdf

Please sign in to comment.