Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1333400imm; Thu, 23 Aug 2018 01:00:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaS1GuKFf+XgW2j6xtmn/lCJNp66DsH31HEFucIe36qEnsCXFT05a6cczfqwEU8yo5HYm76 X-Received: by 2002:a65:508b:: with SMTP id r11-v6mr7908279pgp.271.1535011213048; Thu, 23 Aug 2018 01:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011213; cv=none; d=google.com; s=arc-20160816; b=yvD5xs++jfDVOyMm27+7LoAP3Xsu9oHlhxeCkstfJnjdvzpg8mZVlm1SiZfyQ8ASfN H4f4EXK8h2/gK721NOEnlA0gQ8zz+LWpwNzfzVlQDCesVko44/tb2hFeJbo3QPOrXHUy 1JwmE9+vKYpi9pUztYsSDJg9rqpS/zbjuo7EoKTXA78neHnLCMmdiyJlbsa/zum5jbbq sd5bgj5clWy7lg0oMcpvK/1ljH7hALd6J0CRxwZ24vNZHCI6a307EBTdk9hPfR8FQsKe ZLSB0VFrww63XDq0Z9ii+f5QYtuWKf7WOY+YQSEJoVeLT6uObpXiT+MlTs4S9nV+ECJx SCbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yOysT83yRfm3GfPYhX3C/Cizp/zWKVrUEEi+hloTB04=; b=KclGJxD99O5SY4tFdD2rscMYC6zk2pQWZzAOklXKe1V+6XGHsTqaRhb88MkCslgzbF vnstN46lkryc23hQ0QYu0XYCMsYEOW/EveUGVSZn37k6HazXn7jXKXh8IUmT3iqnf6zr 9mqFgEWhFAbxZmJTAHYp7HKO5I55VxeSKSsxgknTuwMAhN4nKCAWMcz8MVrXFqU0K54d Zoynk+lQRK3v9xwowJSnBtSFMoURZnKEeuFm0lD8cDOlNI4Zuvvv50kZnEWy2HhtSCgi bOB367HqdSBHyyn/IzzBCV+fFmd4cpv/FUfkilK/s4Ou4EpsyD60ABQvTKy9k2waIQp6 uJ9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si3455057plh.285.2018.08.23.00.59.58; Thu, 23 Aug 2018 01:00:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbeHWL0W (ORCPT + 99 others); Thu, 23 Aug 2018 07:26:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41698 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726995AbeHWL0W (ORCPT ); Thu, 23 Aug 2018 07:26:22 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 59BD9ACC; Thu, 23 Aug 2018 07:57:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ajay Gupta , Nagaraj Annaiah , Mathias Nyman , Sasha Levin Subject: [PATCH 4.4 26/79] usb: xhci: increase CRS timeout value Date: Thu, 23 Aug 2018 09:53:02 +0200 Message-Id: <20180823074920.443357292@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ajay Gupta [ Upstream commit 305886ca87be480ae159908c2affd135c04215cf ] 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 [reformat code comment -Mathias] Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1052,8 +1052,13 @@ int xhci_resume(struct xhci_hcd *xhci, b command = readl(&xhci->op_regs->command); command |= CMD_CRS; writel(command, &xhci->op_regs->command); + /* + * Some controllers take up to 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;