CHROMIUM: xhci: fix USB3 device undetected after resume
authorWilliam wu <wulf@rock-chips.com>
Mon, 21 Nov 2016 06:06:19 +0000 (14:06 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 20 Apr 2017 08:28:56 +0000 (16:28 +0800)
commit12b5fa422aa349d8e50b8811c526de1ade4f12e1
treed5b2017558e84dab25e8141c6aa8c385b03af796
parent7a1ac7109655388d1b5674e63d566f1fc12ff5f2
CHROMIUM: xhci: fix USB3 device undetected after resume

Some xHC controllers (e.g. Rockchip rk3399) integrated in
DWC3 IP, will be powered down in S3, and reinitialized after
resume.

However, if a USB3 device is plugged before system enter S3,
the device will be disconnected after resume because of xHC
lose power. And the device can't be detected again even if
we reinitialize xHC. In this case, CCS and CSC is '0' and
can't reflect the current state of the port, also the link
state stays in Rx.Detect.

So try to do warm reset on resume to reset USB3 device to
the default state, also reset a USB3 link, and re-exchange
link configuration information.

BUG=chrome-os-partner:58347
TEST=Plug an USB3 flash drive in rk3399 Kevin board Type-C
port, then set system enter S3. Wakeup system, check if USB3
device can be detected after resume.

Change-Id: I90975a48866569f2c2422a244afc618a3e427f57
Signed-off-by: William wu <wulf@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/412487
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Tested-by: Inno Park <ih.yoo.park@samsung.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci.h
include/linux/usb/xhci_pdriver.h