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>
Thu, 12 Mar 2020 16:34:49 +0000 (17:34 +0100)
commitceca49382ac20e06ce04c21279c7f2868c4ec1d4
tree4c5435efa61e65fd0f67716541b79d205b293d8c
parent0200b9f790b0fc9e9a42f685f5ad54b23fe959f4
xhci: Finetune host initiated USB3 rootport link suspend and resume

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>
drivers/usb/host/xhci-hub.c