Skip to contentSkip to conversation

usbnet: fix status interrupt urb handling

PATCH In review Felix Fietkau 5 participants 6 messages Nov 12, 2013 – Nov 14, 2013 3 messages not in the archive

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

PATCH 1/1 usbnet: fix status interrupt urb handling

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

---
 drivers/net/usb/usbnet.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/usb/usbnet.c +0 -2
index 90a429b..8494bb5 100644
@@ -204,9 +204,6 @@ static void intr_complete (struct urb *urb)
 		break;
 	}
 
-	if (!netif_running (dev->net))
-		return;

A message that is not in the archive (sent off-list or not yet received): 1384270481-30972-1-git-send-email-nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org

Tested-by
#2 lore raw
Quoted 10 lines · Felix Fietkau

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

Quoted 9 lines
---
 drivers/net/usb/usbnet.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/usb/usbnet.c +0 -0
index 90a429b..8494bb5 100644

drivers/net/usb/usbnet.c static void intr_complete (struct urb *urb) · line 209

Quoted 9 lines
drivers/net/usb/usbnet.c +0 -3
@@ -204,9 +204,6 @@ static void intr_complete (struct urb *urb)
 		break;
 	}
 
-	if (!netif_running (dev->net))
-		return;
-
 	status = usb_submit_urb (urb, GFP_ATOMIC);
 	if (status != 0)
 		netif_err(dev, timer, dev->net,

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive
Quoted 7 lines · Felix Fietkau

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

And what about the other drivers for whom this patch means added traffic? This fix is done with a sledge hammer and cares only about some drivers.
I'd much prefer you introduced a driver flag for this.

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 6 lines · Oliver Neukum
Quoted 5 lines · Felix Fietkau

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

Quoted 6 lines
Quoted 2 lines

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

And what about the other drivers for whom this patch means added traffic? This fix is done with a sledge hammer and cares only about some drivers.

usbnet_stop calls usbnet_status_stop which kills the status URB, unless the driver explicitly asked for it not to be killed. And the callback properly returns on status == -ENOENT, before the lines in question.

So I think Felix is right. None of the other drivers will ever hit the
code he deletes. It only affects sierra_net, and that is unwanted.

Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 87r4akoefv.fsf-lbf33ChDnrE/[email protected]

#7 lore raw
Quoted 15 lines · Bjørn Mork
Quoted 6 lines · Oliver Neukum
Quoted 5 lines · Felix Fietkau

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

Quoted 6 lines
Quoted 2 lines

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

And what about the other drivers for whom this patch means added traffic? This fix is done with a sledge hammer and cares only about some drivers.

Quoted 6 lines

usbnet_stop calls usbnet_status_stop which kills the status URB, unless the driver explicitly asked for it not to be killed. And the callback properly returns on status == -ENOENT, before the lines in question.

So I think Felix is right. None of the other drivers will ever hit the
code he deletes. It only affects sierra_net, and that is unwanted.

True. I take back the objection.

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to a message not in the archive

From: Felix Fietkau <[email protected]>
Date: Tue, 12 Nov 2013 16:34:41 +0100

Quoted 9 lines

Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response).

To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running().

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html