usb: host: xhci: Clean up commands when stop endpoint command is timeout

Message ID
State New
Headers show

Commit Message

(Exiting) Baolin Wang Dec. 13, 2016, 9:22 a.m.
Since the stop endpoint command is timeout, we will halt the xHCI
controller and issuing the usb_hc_died() to report abnormal shutdown
of a host controller, but before that, we should clean up the command
queue to free commands memory and complete the pending commands.

Signed-off-by: Baolin Wang <>

 drivers/usb/host/xhci-ring.c |    1 +
 1 file changed, 1 insertion(+)


To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to
More majordomo info at


diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index edc9ac2..92b48fe 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -904,6 +904,7 @@  void xhci_stop_endpoint_command_watchdog(unsigned long arg)
 			xhci_kill_endpoint_urbs(xhci, i, j);
 	spin_unlock_irqrestore(&xhci->lock, flags);
+	xhci_cleanup_command_queue(xhci);
 	xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
 			"Calling usb_hc_died()");