Skip to content

Commit 5eeb313

Browse files
Ming Leidavem330
authored andcommitted
usbnet: decrease suspend count if returning -EBUSY for runtime suspend
This patch decreases dev->suspend_count in the -EBUSY failure path of usbnet_suspend. Without the change, the later runtime suspend will do nothing except for increasing dev->suspend_count. Signed-off-by: Ming Lei <ming.lei@canonical.com> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fb13c47 commit 5eeb313

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/usb/usbnet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
15151515
spin_lock_irq(&dev->txq.lock);
15161516
/* don't autosuspend while transmitting */
15171517
if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
1518+
dev->suspend_count--;
15181519
spin_unlock_irq(&dev->txq.lock);
15191520
return -EBUSY;
15201521
} else {

0 commit comments

Comments
 (0)