]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00177756 usb-host: quit system suspend after usb remote wakeup occurs
authorPeter Chen <peter.chen@freescale.com>
Fri, 23 Mar 2012 07:20:09 +0000 (15:20 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:19 +0000 (08:34 +0200)
If the usb remote wakeup occurs before bus(roothub) suspend, it can
stop the system suspend process, the patch adds handle error message
process for roothub.

If the remote wakeup occurs after bus(roothub) suspend, then
the suspend will go on suspending, and usb phy will fail to respond
wakeup signal.

This patch is suggested by: Alan Stern <stern@rowland.harvard.edu>
see: http://www.spinics.net/lists/linux-usb/msg58774.html

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/core/driver.c

index 75b4bc03e2e1a13d2d852ebce3ae1a19df2f8b79..f147c620d0cb374a316e78bc8ff37d6863788ace 100644 (file)
@@ -1198,8 +1198,13 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
        if (status == 0) {
                status = usb_suspend_device(udev, msg);
 
-               /* Again, ignore errors during system sleep transitions */
-               if (!(msg.event & PM_EVENT_AUTO))
+              /*
+               * Ignore errors from non-root-hub devices during
+               * system sleep transitions.  For the most part,
+               * these devices should go to low power anyway when
+               * the entire bus is suspended.
+               */
+               if (udev->parent && !(msg.event & PM_EVENT_AUTO))
                        status = 0;
        }