From 9096efd46330e0d053cba811edfaec7a0d054c01 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 12 Mar 2018 12:38:06 -0700 Subject: [PATCH] usb: xhci: Reduce command abort handshake timeout Once command completion times out (5 sec), command abort operation is currently perfomed with local irq disabled and spinlock held for 5 sec timeout. In case xHC becomes unresponsive for some reason this results into watchdog bark. Hence reduce timeout value from 5 sec to 1 sec to initiate recovery faster. Change-Id: I1383721ce1d25bc40fb0e7620135fafcba6d5640 Signed-off-by: Hemant Kumar Signed-off-by: Jack Pham Signed-off-by: Chandana Kishori Chiluveru --- drivers/usb/host/xhci-ring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 24c43a704ede..142c1eca172c 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -351,13 +351,13 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags) &xhci->op_regs->cmd_ring); /* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the - * completion of the Command Abort operation. If CRR is not negated in 5 - * seconds then driver handles it as if host died (-ENODEV). + * completion of the Command Abort operation. If CRR is not negated in a + * timely manner then driver handles it as if host died (-ENODEV). * In the future we should distinguish between -ENODEV and -ETIMEDOUT * and try to recover a -ETIMEDOUT with a host controller reset. */ ret = xhci_handshake(&xhci->op_regs->cmd_ring, - CMD_RING_RUNNING, 0, 5 * 1000 * 1000); + CMD_RING_RUNNING, 0, 1000 * 1000); if (ret < 0) { xhci_err(xhci, "Abort failed to stop command ring: %d\n", ret); xhci_halt(xhci);