Received: by 10.223.185.116 with SMTP id b49csp4102641wrg; Mon, 19 Feb 2018 11:07:22 -0800 (PST) X-Google-Smtp-Source: AH8x2242EdMjPw9mbrkwoLhcuZOOzLGdJ1HfWOYAwLX0it/2ZzTgFJynuWLZ9uGC0t6cU4xTTmYF X-Received: by 10.101.89.74 with SMTP id g10mr13045613pgu.415.1519067242501; Mon, 19 Feb 2018 11:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519067242; cv=none; d=google.com; s=arc-20160816; b=gHCCFKrCMyFuRsYPPX9b1yitQBP8miba718evTahLVwgLsmhrnXTLCwMRPZM0uS1lP HXqL22Iv/GLLkqBk7hPMJ3ZbFBaDOcEn/gmLaUOn0FbQzv/Iug1RYLCrM56qS70CNIEN 4oBmrgAGhLh05UiNar2n+ba+r0g7ppU0Y51G8o+381TU9KJsUa0N67zLqJOyBqfwvY7Z oaC3pfQ44B94wFvcKowXBnNAbPAnH9yg3to/DLqQ8PTdr6POd32gVXxnf2jn2L/jF7ls lXjmClXuAr/lzFRjlPanLVaGStltIeiIT28x5Kr7uqMFy4D4RjUdh85KoiH9YDA2jrMF uKqA== 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 :arc-authentication-results; bh=t5ohgLlYvQQy0T5X3kyCl/o7sYhyPNujmOHP4xLF5q8=; b=iJA2CF0Gbr+8n5uPboZOPkHUB3/h+VpO1JZx7xCIPBRjjDG0gi2KZMYfH+IXKpIF1X 3z/vdxoH/7yTJqC8o7LCG7AxJBo9teBBAD5X+HDMsY5bC2/GtTYhGOj0/nsKEMp5YJ6J VAfOn4UKodJqvMHeYSsv40KljxNy0oBb1MrXl22X+Qiw96lsr8tP7eJAsKjlI3e6oQXM tmYEgmz1LdC8TxTToHiDeWApN2Rsa+t1sAOrMfZO0032VKVy5RR2mr2e9nxWC/UoIU7A kU9iHT+xpsw+f096Ig+SbNf5OTZG7WYbuH7TN8IOZGAJUCW5aGzxQHhTyGyWBvLXBjtX C1JQ== 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 m12-v6si6422023pln.400.2018.02.19.11.07.08; Mon, 19 Feb 2018 11:07:22 -0800 (PST) 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 S1753690AbeBSTG3 (ORCPT + 99 others); Mon, 19 Feb 2018 14:06:29 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:44893 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753452AbeBSTG3 (ORCPT ); Mon, 19 Feb 2018 14:06:29 -0500 Received: from 114-32-108-117.hinet-ip.hinet.net ([114.32.108.117] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1enqle-0006ye-6w; Mon, 19 Feb 2018 19:06:26 +0000 From: Kai-Heng Feng To: mathias.nyman@intel.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH v2] xhci: Fix front USB ports on ASUS PRIME B350M-A Date: Tue, 20 Feb 2018 03:06:21 +0800 Message-Id: <20180219190621.6632-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a USB device gets plugged on ASUS PRIME B350M-A's front ports, the xHC stops working: [ 549.114587] xhci_hcd 0000:02:00.0: WARN: xHC CMD_RUN timeout [ 549.114608] suspend_common(): xhci_pci_suspend+0x0/0xc0 returns -110 [ 549.114638] xhci_hcd 0000:02:00.0: can't suspend (hcd_pci_runtime_suspend returned -110) Delay before running xHC command CMD_RUN can workaround the issue. Use a new quirk to make the delay only targets to the affected xHC. Signed-off-by: Kai-Heng Feng --- v2: Instead of doing xHC reset and disabling D3cold, a simple delay can workaround the issue. Now both high-speed and super-speed devices work fine with the v2 quirk. drivers/usb/host/xhci-pci.c | 3 +++ drivers/usb/host/xhci.c | 3 +++ drivers/usb/host/xhci.h | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 6c79037876db..9a820b3cae56 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -122,6 +122,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info()) xhci->quirks |= XHCI_AMD_PLL_FIX; + if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x43bb) + xhci->quirks |= XHCI_SUSPEND_DELAY; + if (pdev->vendor == PCI_VENDOR_ID_AMD) xhci->quirks |= XHCI_TRUST_TX_LENGTH; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1eeb3396300f..d554bbd694d3 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -878,6 +878,9 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); del_timer_sync(&xhci->shared_hcd->rh_timer); + if (xhci->quirks & XHCI_SUSPEND_DELAY) + usleep_range(1000, 1500); + spin_lock_irq(&xhci->lock); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 96099a245c69..6f1f52f3cb40 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1825,6 +1825,7 @@ struct xhci_hcd { /* Reserved. It was XHCI_U2_DISABLE_WAKE */ #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28) #define XHCI_HW_LPM_DISABLE (1 << 29) +#define XHCI_SUSPEND_DELAY (1 << 30) unsigned int num_active_eps; unsigned int limit_active_eps; -- 2.15.1