diff mbox

usb: usbnet: suspend count gets lost when -EBUSY

Message ID CADuEq9BQX2BFBY3pF=CEEymfK4JPwMP7By+JZFdaLqxs+GhtJQ@mail.gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Chris Fries July 6, 2011, 1:35 a.m. UTC
When suspend is refused due to pending transmits, the
busy counter gets out of sync, and suspend will stop
working correctly.

Signed-off-by: Chris Fries <C.Fries@motorola.com>
---
 drivers/net/usb/usbnet.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

 			set_bit(EVENT_DEV_ASLEEP, &dev->flags);

Comments

David Miller July 6, 2011, 1:40 a.m. UTC | #1
From: Chris Fries <qcf001@motorola.com>
Date: Tue, 5 Jul 2011 20:35:05 -0500

> +++ b/drivers/net/usb/usbnet.c
> @@ -1451,6 +1451,7 @@ int usbnet_suspend (struct usb_interface *intf,
> pm_message_t message)

Your email client has mangled your patch, please read
"Documentation/email-clients.txt" on how to fix this.

Once you've fixed it, email the patch to yourself and
verify that you yourself can successfully apply the
patch you receive.
--
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
Greg KH July 7, 2011, 8:50 p.m. UTC | #2
On Tue, Jul 05, 2011 at 08:35:05PM -0500, Chris Fries wrote:
> When suspend is refused due to pending transmits, the
> busy counter gets out of sync, and suspend will stop
> working correctly.
> 
> Signed-off-by: Chris Fries <C.Fries@motorola.com>
> ---
>  drivers/net/usb/usbnet.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>
--
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 cc95aad..9bcc3e3 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1451,6 +1451,7 @@  int usbnet_suspend (struct usb_interface *intf,
pm_message_t message)
 		/* don't autosuspend while transmitting */
 		if (dev->txq.qlen && (message.event & PM_EVENT_AUTO)) {
 			spin_unlock_irq(&dev->txq.lock);
+			dev->suspend_count--;
 			return -EBUSY;
 		} else {