OSDN Git Service

xhci: plat: Fix xhci_plat shutdown hung
authorLei wang <leiwan@codeaurora.org>
Fri, 2 Feb 2018 03:22:38 +0000 (11:22 +0800)
committerGerrit - the friendly Code Review server <code-review@localhost>
Fri, 2 Feb 2018 04:38:33 +0000 (20:38 -0800)
xhci-plat Shutdown callback should check HCD_FLAG_HW_ACCESSIBLE
before accessing any register. This should avoid hung with access
controllers which support runtime suspend

Change-Id: I53eedf5b8f77dfdfa31d21b303da7058c5a86ba9
Signed-off-by: Lei wang <leiwan@codeaurora.org>
drivers/usb/host/xhci.c

index 5e133de..7e76573 100644 (file)
@@ -763,6 +763,10 @@ void xhci_shutdown(struct usb_hcd *hcd)
                usb_disable_xhci_ports(to_pci_dev(hcd->self.controller));
 
        spin_lock_irq(&xhci->lock);
+       if (!HCD_HW_ACCESSIBLE(hcd)) {
+               spin_unlock_irq(&xhci->lock);
+               return;
+       }
        xhci_halt(xhci);
        /* Workaround for spurious wakeups at shutdown with HSW */
        if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)