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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:43 +0000 (00:43 +0100)
commitadc4185584c4fd1c057cafe152fc69994a9786e6
tree1efa0496fdc0f6643f18a06bdd77ee91764194d5
parent48302fa5e081367809c2c2dd5cb43ef56f89877d
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: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/core/hub.c