diff options
author | Soohoon Lee <Soohoon.Lee@f5.com> | 2016-06-29 15:07:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-30 09:05:05 -0400 |
commit | 43daa96b166c3cf5ff30dfac0c5efa2620e4beab (patch) | |
tree | 56feb59ab0b7389f6a68eba14763db87d7d4b184 /drivers/net/usb | |
parent | fedbb6b4ff341c1e2120f4ffbf367fd78ac3e8f3 (diff) | |
download | linux-43daa96b166c3cf5ff30dfac0c5efa2620e4beab.tar.gz linux-43daa96b166c3cf5ff30dfac0c5efa2620e4beab.tar.bz2 linux-43daa96b166c3cf5ff30dfac0c5efa2620e4beab.zip |
usbnet: Stop RX Q on MTU change
When MTU is changed unlink_urbs() flushes RX Q but mean while usbnet_bh()
can fill up the Q at the same time.
Depends on which HCD is down there unlink takes long time then the flush
never ends.
Signed-off-by: Soohoon Lee <soohoon.lee@f5.com>
Reviewed-by: Kimball Murray <kmurray@f5.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/usbnet.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 61ba46404937..6086a0163249 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu) dev->hard_mtu = net->mtu + net->hard_header_len; if (dev->rx_urb_size == old_hard_mtu) { dev->rx_urb_size = dev->hard_mtu; - if (dev->rx_urb_size > old_rx_urb_size) + if (dev->rx_urb_size > old_rx_urb_size) { + usbnet_pause_rx(dev); usbnet_unlink_rx_urbs(dev); + usbnet_resume_rx(dev); + } } /* max qlen depend on hard_mtu and rx_urb_size */ @@ -1508,8 +1511,9 @@ static void usbnet_bh (unsigned long param) } else if (netif_running (dev->net) && netif_device_present (dev->net) && netif_carrier_ok(dev->net) && - !timer_pending (&dev->delay) && - !test_bit (EVENT_RX_HALT, &dev->flags)) { + !timer_pending(&dev->delay) && + !test_bit(EVENT_RX_PAUSED, &dev->flags) && + !test_bit(EVENT_RX_HALT, &dev->flags)) { int temp = dev->rxq.qlen; if (temp < RX_QLEN(dev)) { |