@@ -482,6 +482,7 @@ static void intr_complete (struct urb *urb)
case -ESHUTDOWN: /* hardware gone */
if (netif_msg_ifdown (dev))
devdbg (dev, "intr shutdown, code %d", status);
+ set_bit(EVENT_INTR_HALT, &dev->flags);
return;
/* NOTE: not throttling like RX/TX, since this endpoint
@@ -1065,6 +1066,13 @@ static void usbnet_bh (unsigned long param)
if (dev->txq.qlen < TX_QLEN (dev))
netif_wake_queue (dev->net);
}
+
+ // try once to resume interrupt URBs if they were halted before
+ if (dev->interrupt && netif_running(dev->net) &&
+ test_bit(EVENT_INTR_HALT, &dev->flags)) {
+ clear_bit(EVENT_INTR_HALT, &dev->flags);
+ usb_submit_urb(dev->interrupt, GFP_KERNEL);
+ }
}
@@ -64,6 +64,7 @@ struct usbnet {
# define EVENT_RX_MEMORY 2
# define EVENT_STS_SPLIT 3
# define EVENT_LINK_RESET 4
+# define EVENT_INTR_HALT 5
};
static inline struct usb_driver *driver_of(struct usb_interface *intf)
Set a flag if the interrupt URB completes with ENOENT as this occurs legitimately during system suspend. When the usbnet_bh is called after resume, test this flag and try once to resubmit the interrupt URB. Signed-off-by: Paul Stewart <pstew@chromium.org> --- drivers/net/usb/usbnet.c | 8 ++++++++ include/linux/usb/usbnet.h | 1 + 2 files changed, 9 insertions(+), 0 deletions(-)