This is a note to let you know that I've just added the patch titled

    USB: don't let errors prevent system sleep

to the 2.6.32-longterm tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
     usb-don-t-let-errors-prevent-system-sleep.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm 
tree,
please let <[email protected]> know about it.


>From 0af212ba8f123c2eba151af7726c34a50b127962 Mon Sep 17 00:00:00 2001
From: Alan Stern <[email protected]>
Date: Wed, 15 Jun 2011 16:27:43 -0400
Subject: USB: don't let errors prevent system sleep

From: Alan Stern <[email protected]>

commit 0af212ba8f123c2eba151af7726c34a50b127962 upstream.

This patch (as1464) implements the recommended policy that most errors
during suspend or hibernation should not prevent the system from going
to sleep.  In particular, failure to suspend a USB driver or a USB
device should not prevent the sleep from succeeding:

Failure to suspend a device won't matter, because the device will
automatically go into suspend mode when the USB bus stops carrying
packets.  (This might be less true for USB-3.0 devices, but let's not
worry about them now.)

Failure of a driver to suspend might lead to trouble later on when the
system wakes up, but it isn't sufficient reason to prevent the system
from going to sleep.

Signed-off-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/core/driver.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1187,13 +1187,22 @@ static int usb_suspend_both(struct usb_d
                for (; i < udev->actconfig->desc.bNumInterfaces; i++) {
                        intf = udev->actconfig->interface[i];
                        status = usb_suspend_interface(udev, intf, msg);
+
+                       /* Ignore errors during system sleep transitions */
+                       if (!(msg.event & PM_EVENT_AUTO))
+                               status = 0;
                        if (status != 0)
                                break;
                }
        }
-       if (status == 0)
+       if (status == 0) {
                status = usb_suspend_device(udev, msg);
 
+               /* Again, ignore errors during system sleep transitions */
+               if (!(msg.event & PM_EVENT_AUTO))
+                       status = 0;
+       }
+
        /* If the suspend failed, resume interfaces that did get suspended */
        if (status != 0) {
                pm_message_t msg2;


Patches currently in longterm-queue-2.6.32 which might be from 
[email protected] are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-fix-regression-occurring-during-device-removal.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-don-t-let-the-hub-driver-prevent-system-sleep.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-don-t-let-errors-prevent-system-sleep.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to