xhci: Finetune host initiated USB3 rootport link suspend and resume
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 12 Mar 2020 14:45:16 +0000 (16:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:33:03 +0000 (16:33 +0200)
commit2be21320076de0b23efb1f3d2103e1b3cd307b74
tree61519efc2c432eb32a2359ce835138c92e2ad944
parentea6f7011c42db70b6380480d0561d8f9402d6f76
xhci: Finetune host initiated USB3 rootport link suspend and resume

[ Upstream commit ceca49382ac20e06ce04c21279c7f2868c4ec1d4 ]

Depending on the current link state the steps to resume the link to U0
varies. The normal case when a port is suspended (U3) we set the link
to U0 and wait for a port event when U3exit completed and port moved to
U0.

If the port is in U1/U2, then no event is issued, just set link to U0

If port is in Resume or Recovery state then the device has already
initiated resume, and this host initiated resume is racing against it.
Port event handler for device initiated resume will set link to U0,
just wait for the port to reach U0 before returning.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200312144517.1593-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci-hub.c