UPSTREAM: usbcore: enable USB2 LPM if port suspend fails
authorAndiry Xu <andiry.xu@gmail.com>
Fri, 4 May 2012 16:50:10 +0000 (00:50 +0800)
committerChromeBot <chrome-bot@google.com>
Fri, 22 Mar 2013 01:02:08 +0000 (18:02 -0700)
commita06414109e6aca3ea22709d04f8c3557aebba98f
tree0a1acc16260e5ecbe625e6561d6a08504b51fbdd
parent6febf4d3a6413d20ac59449c0b5c61bfabbb7362
UPSTREAM: usbcore: enable USB2 LPM if port suspend fails

commit c3e751e4f4754793bb52bd5ae30e9cc027edbb12 upstream.

USB2 LPM is disabled when device begin to suspend and enabled after device
is resumed. That's because USB spec does not define the transition from
U1/U2 state to U3 state.

If usb_port_suspend() fails, usb_port_resume() is never called, and USB2 LPM
is disabled in this situation. Enable USB2 LPM if port suspend fails.

This patch should be backported to kernels as old as 3.2, that contain
the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2
hardware LPM".

Signed-off-by: Andiry Xu <andiry.xu@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit edad2199132a88f160c4939d1ad3eecc4c33b211)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I3762df7d8d42c3d8228b1f19ce5f1439e19457e1
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46055
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
drivers/usb/core/hub.c