diff mbox

[-v1,2/3] usbnet: decrease suspend count if returning -EBUSY for runtime suspend

Message ID 1340176553-32225-3-git-send-email-ming.lei@canonical.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Ming Lei June 20, 2012, 7:15 a.m. UTC
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>
---
 drivers/net/usb/usbnet.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Oliver Neukum June 20, 2012, 7:45 a.m. UTC | #1
Am Mittwoch, 20. Juni 2012, 09:15:52 schrieb Ming Lei:
> 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>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index f06cf9b..9bfa775 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1508,6 +1508,7 @@  int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
 		spin_lock_irq(&dev->txq.lock);
 		/* don't autosuspend while transmitting */
 		if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
+			dev->suspend_count--;
 			spin_unlock_irq(&dev->txq.lock);
 			return -EBUSY;
 		} else {