xhci: rework bus_resume and check ports are suspended before resuming them.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 16 Aug 2017 11:23:26 +0000 (14:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 22:26:26 +0000 (15:26 -0700)
commita85c0f8db3329ab433dab49322616e6985317cd7
tree86a2dffb8009798f09b2d8e234e740ad108b1385
parent74072bae88fb3b0f8b54ec88055abfda758fcba1
xhci: rework bus_resume and check ports are suspended before resuming them.

bus_resume() tried to resume the same ports the bus_suspend()
suspeded. This caused PLC timeouts in case a suspended device disconnected
and was not in a resumable state at bus_resume().

Add a check to make sure the link state is either U3 or resuming
before actually resuming the link.

At the same time do some other changes such as make sure we remove
wake on connect/disconnect/overcurrent also for the resuming ports,
and avoid extra portsc port register writes.

This improves resume time with 10ms in those PLC timeout cases where
devices disconnect at suspend/resume cycle.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c