mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
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>
This commit is contained in:
@@ -774,6 +774,9 @@ static void xhci_shutdown(struct usb_hcd *hcd)
|
||||
{
|
||||
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
|
||||
|
||||
if (!hcd->rh_registered)
|
||||
return;
|
||||
|
||||
if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
|
||||
usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user