Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2379002ybn; Thu, 26 Sep 2019 11:00:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBn/DDsAvLTZs+M3VYJTH/qlExviRnoZaSVxF/YOVhC+wcGltwiz9t038BIfooWdF5UwXV X-Received: by 2002:a50:b0c5:: with SMTP id j63mr54292edd.90.1569520817362; Thu, 26 Sep 2019 11:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569520817; cv=none; d=google.com; s=arc-20160816; b=cTKeRmvZZRRpn5xM8kmQo7D+HU7L6SXwD/RgcJCKTo+joo2CV9ZNjy/AYyuztnm/Cd tkimX3u3yJ+43a6yg2PCdYtkHQ6tYIGdKgngKe9l9dGHXXSIthAEJxGVtglUGhSiGrvx 2PxvDsLWU7lWFAm4x3rClblKW0V0fQWBIDSr/mSSOQNNHlkDrCD2Qd0l3tfpPReqiMSz 3ttbBzdKp76d3uyw70/LtKTxTEysr1kmf6sxUZkaFXbSMem3EHMCwI7D5pGR5LnGroxF kEO+BKMYO3wewqQmwgyWkT3XMAjrVye/5v7IW0DGvSdvuKaOxc21gg89rf6VFmY5uYCD uZ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=NAbO7pZObtnyTHdFLnkleVLjjmuVWR6pMU5z8Izie0o=; b=BvJqDO8Xn7Fl0b4YUffTiJ1YYbG9JzsiHNQaFOox5EKYefry+ouHxu7pNxOKx93zq2 pLkaM3zvO3/eo2MzoRXWpSV9EqBf0JyNRo1zATIsIB7OaaYv8mjUjrdlfiK9/NE2sxGz nDiDXBr6szmv7Cmos5ajhyHS7ZQfyt8TAxwsNH2W+aNqTwstfBBusAdXBC7KmmvY8sOM u0CFrFzlEb04VsDNrljOy+IzdKjnajMhB6NB6Ei6UUmDL4Jmpj0VZch6ds+8nw5cLPNV MjPbGZlux//t8U0PA+hWiB3noD2ZUzlGe8zkeXSBHq8zniAIu62lVjx1xhaViiq9VkRb WS0g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si1398667ejb.44.2019.09.26.10.59.51; Thu, 26 Sep 2019 11:00:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728417AbfIZR5g (ORCPT + 99 others); Thu, 26 Sep 2019 13:57:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40905 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbfIZR5e (ORCPT ); Thu, 26 Sep 2019 13:57:34 -0400 Received: from 61-220-137-37.hinet-ip.hinet.net ([61.220.137.37] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iDY1D-00073N-OF; Thu, 26 Sep 2019 17:57:32 +0000 From: Kai-Heng Feng To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH] xhci: Increase STS_SAVE timeout in xhci_suspend() Date: Fri, 27 Sep 2019 01:57:22 +0800 Message-Id: <20190926175722.2507-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()"), ASMedia xHCI may fail to suspend. Although the algorithms are essentially the same, the old max timeout is (usec + usec * time of doing readl()), and the new max timeout is just usec, which is much less than the old one. Increase the timeout to make ASMedia xHCI able to suspend again. BugLink: https://bugs.launchpad.net/bugs/1844021 Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()") Signed-off-by: Kai-Heng Feng --- drivers/usb/host/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 559b639337fb..100493eb9691 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1032,7 +1032,7 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) writel(command, &xhci->op_regs->command); xhci->broken_suspend = 0; if (xhci_handshake(&xhci->op_regs->status, - STS_SAVE, 0, 10 * 1000)) { + STS_SAVE, 0, 20 * 1000)) { /* * AMD SNPS xHC 3.0 occasionally does not clear the * SSS bit of USBSTS and when driver tries to poll -- 2.17.1