[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.16 / 0033-USB-don-t-ignore-suspend-errors-for-root-hubs.patch
1 From 76cec389c13edcc348d13a0efc7351752c3f71e3 Mon Sep 17 00:00:00 2001
2 From: Alan Stern <stern@rowland.harvard.edu>
3 Date: Wed, 28 Mar 2012 15:56:17 -0400
4 Subject: [PATCH 33/68] USB: don't ignore suspend errors for root hubs
6 commit cd4376e23a59a2adf3084cb5f4a523e6d5fd4e49 upstream.
8 This patch (as1532) fixes a mistake in the USB suspend code. When the
9 system is going to sleep, we should ignore errors in powering down USB
10 devices, because they don't really matter. The devices will go to low
11 power anyway when the entire USB bus gets suspended (except for
12 SuperSpeed devices; maybe they will need special treatment later).
14 However we should not ignore errors in suspending root hubs,
15 especially if the error indicates that the suspend raced with a wakeup
16 request. Doing so might leave the bus powered on while the system was
17 supposed to be asleep, or it might cause the suspend of the root hub's
18 parent controller device to fail, or it might cause a wakeup request
19 to be ignored.
21 The patch fixes the problem by ignoring errors only when the device in
22 question is not a root hub.
24 Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
25 Reported-by: Chen Peter <B29397@freescale.com>
26 Tested-by: Chen Peter <peter.chen@freescale.com>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 ---
29 drivers/usb/core/driver.c | 9 +++++++--
30 1 file changed, 7 insertions(+), 2 deletions(-)
32 diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
33 index 45887a0..c77f0d6 100644
34 --- a/drivers/usb/core/driver.c
35 +++ b/drivers/usb/core/driver.c
36 @@ -1198,8 +1198,13 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
37 if (status == 0) {
38 status = usb_suspend_device(udev, msg);
40 - /* Again, ignore errors during system sleep transitions */
41 - if (!PMSG_IS_AUTO(msg))
42 + /*
43 + * Ignore errors from non-root-hub devices during
44 + * system sleep transitions. For the most part,
45 + * these devices should go to low power anyway when
46 + * the entire bus is suspended.
47 + */
48 + if (udev->parent && !PMSG_IS_AUTO(msg))
49 status = 0;
50 }
52 --
53 1.7.10