Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / usb / host / xhci-ring.c
index fa5d8c2f6982b0482b463d2c2e2d6b1c1c1dc418..408eccdd2ca9c7f112463e15486f7b65beab2d68 100644 (file)
@@ -913,17 +913,6 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
        spin_lock_irqsave(&xhci->lock, flags);
 
        ep->stop_cmds_pending--;
-       if (xhci->xhc_state & XHCI_STATE_REMOVING) {
-               spin_unlock_irqrestore(&xhci->lock, flags);
-               return;
-       }
-       if (xhci->xhc_state & XHCI_STATE_DYING) {
-               xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
-                               "Stop EP timer ran, but another timer marked "
-                               "xHCI as DYING, exiting.");
-               spin_unlock_irqrestore(&xhci->lock, flags);
-               return;
-       }
        if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) {
                xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
                                "Stop EP timer ran, but no command pending, "
@@ -4066,7 +4055,8 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
        int ret;
 
        if ((xhci->xhc_state & XHCI_STATE_DYING) ||
-               (xhci->xhc_state & XHCI_STATE_HALTED)) {
+               (xhci->xhc_state & XHCI_STATE_HALTED) ||
+               (xhci->xhc_state & XHCI_STATE_REMOVING)) {
                xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n");
                return -ESHUTDOWN;
        }