From: Sarah Sharp Date: Mon, 23 Jul 2012 23:06:08 +0000 (-0700) Subject: xhci: Increase reset timeout for Renesas 720201 host. X-Git-Tag: v3.2.29~84 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=11181d02b12a7935c32389308a7e46901718be57;p=karo-tx-linux.git xhci: Increase reset timeout for Renesas 720201 host. commit 22ceac191211cf6688b1bf6ecd93c8b6bf80ed9b upstream. The NEC/Renesas 720201 xHCI host controller does not complete its reset within 250 milliseconds. In fact, it takes about 9 seconds to reset the host controller, and 1 second for the host to be ready for doorbell rings. Extend the reset and CNR polling timeout to 10 seconds each. This patch should be backported to kernels as old as 2.6.31, that contain the commit 66d4eadd8d067269ea8fead1a50fe87c2979a80d "USB: xhci: BIOS handoff and HW initialization." Signed-off-by: Sarah Sharp Reported-by: Edwin Klein Mentink [bwh: Backported to 3.2: result of second handshake call is returned directly] Signed-off-by: Ben Hutchings --- diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 05f82e942530..f7c0a2a722b1 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -163,7 +163,7 @@ int xhci_reset(struct xhci_hcd *xhci) xhci_writel(xhci, command, &xhci->op_regs->command); ret = handshake(xhci, &xhci->op_regs->command, - CMD_RESET, 0, 250 * 1000); + CMD_RESET, 0, 10 * 1000 * 1000); if (ret) return ret; @@ -172,7 +172,8 @@ int xhci_reset(struct xhci_hcd *xhci) * xHCI cannot write to any doorbells or operational registers other * than status until the "Controller Not Ready" flag is cleared. */ - return handshake(xhci, &xhci->op_regs->status, STS_CNR, 0, 250 * 1000); + return handshake(xhci, &xhci->op_regs->status, + STS_CNR, 0, 10 * 1000 * 1000); } #ifdef CONFIG_PCI