diff mbox

[v3] usb: xhci: increase CRS timeout value

Message ID 1528751423-12463-1-git-send-email-ajaykuee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ajay Gupta June 11, 2018, 9:10 p.m. UTC
Some controllers take almost 55ms to complete controller
restore state (CRS).
There is no timeout limit mentioned in xhci specification so
fixing the issue by increasing the timeout limit to 100ms

Signed-off-by: Ajay Gupta <ajaykuee@gmail.com>
Signed-off-by: Nagaraj Annaiah <naga.annaiah@gmail.com>
---
Changes from v2->v3
Updated commit message for timeout value to 100ms

Changes from v1->v2
Updated timeout value from 55 to 100ms and added a comment.
 drivers/usb/host/xhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mathias Nyman June 19, 2018, 8:08 a.m. UTC | #1
On 12.06.2018 00:10, Ajay Gupta wrote:
> Some controllers take almost 55ms to complete controller
> restore state (CRS).
> There is no timeout limit mentioned in xhci specification so
> fixing the issue by increasing the timeout limit to 100ms
> 
> Signed-off-by: Ajay Gupta <ajaykuee@gmail.com>
> Signed-off-by: Nagaraj Annaiah <naga.annaiah@gmail.com>
> ---
> Changes from v2->v3
> Updated commit message for timeout value to 100ms
> 
> Changes from v1->v2
> Updated timeout value from 55 to 100ms and added a comment.
>   drivers/usb/host/xhci.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 8c8da2d..fa7bd71 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1043,8 +1043,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
>   		command = readl(&xhci->op_regs->command);
>   		command |= CMD_CRS;
>   		writel(command, &xhci->op_regs->command);
> +		/* Some controllers take upto 55+ ms to complete
> +		 * the controller restore so setting the timeout to
> +		 * 100ms. Xhci specification doesn't mention any
> +		 * timeout value.
> +		 */
>   		if (xhci_handshake(&xhci->op_regs->status,
> -			      STS_RESTORE, 0, 10 * 1000)) {
> +			      STS_RESTORE, 0, 100 * 1000)) {
>   			xhci_warn(xhci, "WARN: xHC restore state timeout\n");
>   			spin_unlock_irq(&xhci->lock);
>   			return -ETIMEDOUT;
> 

Thanks,
Patch looks good, I did however do a minor reformat of comment part.

I'm running this patch together with other 4.18-rc1 fixes through internal first.
I'll send it forward soon (0-2 days)

-Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 8c8da2d..fa7bd71 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1043,8 +1043,13 @@  int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 		command = readl(&xhci->op_regs->command);
 		command |= CMD_CRS;
 		writel(command, &xhci->op_regs->command);
+		/* Some controllers take upto 55+ ms to complete
+		 * the controller restore so setting the timeout to
+		 * 100ms. Xhci specification doesn't mention any
+		 * timeout value.
+		 */
 		if (xhci_handshake(&xhci->op_regs->status,
-			      STS_RESTORE, 0, 10 * 1000)) {
+			      STS_RESTORE, 0, 100 * 1000)) {
 			xhci_warn(xhci, "WARN: xHC restore state timeout\n");
 			spin_unlock_irq(&xhci->lock);
 			return -ETIMEDOUT;