aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci.c10
-rw-r--r--drivers/usb/host/xhci.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 238ebe158b83..2c11411ca5f5 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -98,11 +98,15 @@ void xhci_quiesce(struct xhci_hcd *xhci)
98 */ 98 */
99int xhci_halt(struct xhci_hcd *xhci) 99int xhci_halt(struct xhci_hcd *xhci)
100{ 100{
101 int ret;
101 xhci_dbg(xhci, "// Halt the HC\n"); 102 xhci_dbg(xhci, "// Halt the HC\n");
102 xhci_quiesce(xhci); 103 xhci_quiesce(xhci);
103 104
104 return handshake(xhci, &xhci->op_regs->status, 105 ret = handshake(xhci, &xhci->op_regs->status,
105 STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC); 106 STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC);
107 if (!ret)
108 xhci->xhc_state |= XHCI_STATE_HALTED;
109 return ret;
106} 110}
107 111
108/* 112/*
@@ -129,6 +133,8 @@ int xhci_start(struct xhci_hcd *xhci)
129 xhci_err(xhci, "Host took too long to start, " 133 xhci_err(xhci, "Host took too long to start, "
130 "waited %u microseconds.\n", 134 "waited %u microseconds.\n",
131 XHCI_MAX_HALT_USEC); 135 XHCI_MAX_HALT_USEC);
136 if (!ret)
137 xhci->xhc_state &= ~XHCI_STATE_HALTED;
132 return ret; 138 return ret;
133} 139}
134 140
@@ -1212,7 +1218,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
1212 if (ret || !urb->hcpriv) 1218 if (ret || !urb->hcpriv)
1213 goto done; 1219 goto done;
1214 temp = xhci_readl(xhci, &xhci->op_regs->status); 1220 temp = xhci_readl(xhci, &xhci->op_regs->status);
1215 if (temp == 0xffffffff) { 1221 if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_HALTED)) {
1216 xhci_dbg(xhci, "HW died, freeing TD.\n"); 1222 xhci_dbg(xhci, "HW died, freeing TD.\n");
1217 urb_priv = urb->hcpriv; 1223 urb_priv = urb->hcpriv;
1218 1224
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index e9217bb288ad..e69f1cdf4b5b 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1260,6 +1260,7 @@ struct xhci_hcd {
1260 * There are no reports of xHCI host controllers that display this issue. 1260 * There are no reports of xHCI host controllers that display this issue.
1261 */ 1261 */
1262#define XHCI_STATE_DYING (1 << 0) 1262#define XHCI_STATE_DYING (1 << 0)
1263#define XHCI_STATE_HALTED (1 << 1)
1263 /* Statistics */ 1264 /* Statistics */
1264 int error_bitmask; 1265 int error_bitmask;
1265 unsigned int quirks; 1266 unsigned int quirks;