OSDN Git Service

usb: Handle USB3 remote wakeup for LPM enabled devices correctly
authorLee, Chiasheng <chiasheng.lee@intel.com>
Thu, 20 Jun 2019 07:56:04 +0000 (10:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:34:53 +0000 (09:34 +0200)
commit259cad0a1c173b53a37334cd927e756bbc3059a0
treedd3e25b8ba0d32ba453617fa28d8120971337303
parentc288d39159d24457a5a4030a40ebf2d279f7f137
usb: Handle USB3 remote wakeup for LPM enabled devices correctly

commit e244c4699f859cf7149b0781b1894c7996a8a1df upstream.

With Link Power Management (LPM) enabled USB3 links transition to low
power U1/U2 link states from U0 state automatically.

Current hub code detects USB3 remote wakeups by checking if the software
state still shows suspended, but the link has transitioned from suspended
U3 to enabled U0 state.

As it takes some time before the hub thread reads the port link state
after a USB3 wake notification, the link may have transitioned from U0
to U1/U2, and wake is not detected by hub code.

Fix this by handling U1/U2 states in the same way as U0 in USB3 wakeup
handling

This patch should be added to stable kernels since 4.13 where LPM was
kept enabled during suspend/resume

Cc: <stable@vger.kernel.org> # v4.13+
Signed-off-by: Lee, Chiasheng <chiasheng.lee@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c