CHROMIUM: xhci: do shutdown only hcd is registered
authorWilliam wu <wulf@rock-chips.com>
Wed, 19 Oct 2016 11:53:53 +0000 (19:53 +0800)
committerWu Liang feng <wulf@rock-chips.com>
Tue, 1 Nov 2016 03:32:35 +0000 (11:32 +0800)
commit33e3a9340d91b25fc9adc7493bce03d34b3ce9ac
treeae0e48171ddbf59bb450faaa44cf70e36ee72337
parent9f2b1a77cc843060a6dda1d7321535c8ba924e99
CHROMIUM: xhci: do shutdown only hcd is registered

On some sepcial platforms (e.g. rk3399 platform), they will call
usb_remove_hcd() to remove xhci hcd if no device connected, and
also call xhci_stop() to halt and reset xhci. So we don't need to
do the same thing in shutdown if hcd has been unregistered.

In addition to remove hcd, rk3399 platform will disable xhci power
domain in runtime suspend, if we try to access xhci registers in
shutdown, it might cause kernel crash or unexpected behavior.

BUG=chrome-os-partner:59111
TEST=reboot the system

Change-Id: I7ecfce068211ff1c4a884fc4a8a54ca5b84c1c09
Signed-off-by: William wu <wulf@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/401120
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
drivers/usb/host/xhci.c