Skip to contentSkip to conversation

Insert interrupt URB after resume, so that status transfers can flow.

PATCH In review Indrek Peri 2 participants 2 messages Dec 6, 2010 – Dec 7, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Insert interrupt URB after resume, so that status transfers can flow.

---
 drivers/net/usb/usbnet.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/usb/usbnet.c +12 -0
index c04d49e..eaa83f9 100644
@@ -719,6 +719,7 @@ int usbnet_open (struct net_device *net)
 
 	/* start any status interrupt transfer */
 	if (dev->interrupt) {
+		usb_kill_urb(dev->interrupt); /* resume may add int urb */
 		retval = usb_submit_urb (dev->interrupt, GFP_KERNEL);
 		if (retval < 0) {
 			netif_err(dev, ifup, dev->net,
@@ -1495,6 +1496,17 @@ int usbnet_resume (struct usb_interface *intf)
 		spin_unlock_irq(&dev->txq.lock);
 		if (!(dev->txq.qlen >= TX_QLEN(dev)))
 			netif_start_queue(dev->net);
+
+		/* start any status interrupt transfer */
+		if (dev->interrupt) {
+			retval = usb_submit_urb(dev->interrupt, GFP_KERNEL);
+			if (retval < 0) {
+				netif_err(dev, ifup, dev->net,
+				  "intr submit %d\n", retval);
+				return retval;
+			}
+		}
+
 		tasklet_schedule (&dev->bh);
 	}
 	return 0;
Signature · 1 line
1.7.0.3
#1 lore raw

Building on my comment about your other patch ... shouldn't this be just another part of the "resume driver" action,
like refilling the RX urb queue?

For the same reasons ... NAK. It looks like the work to add suspend and resume processing to this driver had a few holes, and resume handling can be simplified by combining re-activation of RX processing and this status reporting (where relevant) in one routine.

- Dave