Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2301991imm; Thu, 7 Jun 2018 08:26:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIBHXE/PYgs56+8+uogz/fFXbHajhXTzFUv7aCSBdfSEDY5A/JxLI5jg/2lNzUsDCIS8Id9 X-Received: by 2002:a17:902:b28c:: with SMTP id u12-v6mr2559775plr.68.1528385205063; Thu, 07 Jun 2018 08:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528385205; cv=none; d=google.com; s=arc-20160816; b=tvYWqede9oQ3sczHrUR6W1M3WlMzl+JK6ghz4eOKRmrdgmarMm7/7e48LR01+k+65E 977Z6dPtoED01AHgLFbPX9PjJ4k0/kgUhf30HC/AiiteQRrvegJ2iDAR2CSS1Fp0FRfS WPiS8J9YNghBmiFk//rlaywU0xISQqnOjSED40ExtNhn35NLeqsxe6e1ZRYWnrf2VhVc Hb7YA4UmBuKzKRWcZv0Sg5asaWZzxt95Tyj8/tNrwy59ZHYHahI0OOooAvfQLBYQdYcZ 5coviz0det39btvqSvQNwvzOQ8yUMJQMueJwZSnCxBYi15/9U2rFDcleoWJijwNK9OJc TAuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=UMwItYiN8Hf48B4nKYhQwvZ+pbOSv4Y2RnxDeksfOv0=; b=ARWMOuwu/QXoFqd4vkzPAW+yttddz6Pg7SR2y2P6eZt82IU33OPpFcZzHw7/pmdVTX IvhepLwIYzE+ElXpLAiTjSdbBVK5oFTb9rraI+uJ6YFpYq2iUva6Che0aXo7TwQqHfY1 iOW7KnobZN45Gc24HKZCgCWI6BZF6teLcvsPrZJOyk7FCNWFjUjiJ8oQegGUKU5Q9U79 U7wkkNBGyucvhsU1j4FefTaAHGQKexQ2sRNGGEzovz1r+9a+yTEgIBuFkV3XG7BcH42E XLXpafLzhVhO4vIS2a1nILDk5LkdqBTM4BBQa+Zi+2tqEvSi8lhPH3sMD5wY3QdRmb3S tSKA== 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-v6si54097247plz.364.2018.06.07.08.26.27; Thu, 07 Jun 2018 08:26:45 -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 S935729AbeFGPYL (ORCPT + 99 others); Thu, 7 Jun 2018 11:24:11 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41203 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932981AbeFGO6i (ORCPT ); Thu, 7 Jun 2018 10:58:38 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbQ-0005Zo-Ei; Thu, 07 Jun 2018 15:09:24 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbC-0003DG-AS; Thu, 07 Jun 2018 15:09:10 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kroah-Hartman" , "Kai-Heng Feng" , "Mathias Nyman" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 340/410] xhci: Fix front USB ports on ASUS PRIME B350M-A In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Kai-Heng Feng commit 191edc5e2e515aab1075a3f0ef23599e80be5f59 upstream. 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 Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/usb/host/xhci-pci.c | 3 +++ drivers/usb/host/xhci.c | 3 +++ drivers/usb/host/xhci.h | 1 + 3 files changed, 7 insertions(+) --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -124,6 +124,9 @@ static void xhci_pci_quirks(struct devic 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; --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -922,6 +922,9 @@ int xhci_suspend(struct xhci_hcd *xhci, clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); del_timer_sync(&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); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1571,6 +1571,7 @@ struct xhci_hcd { #define XHCI_MISSING_CAS (1 << 24) #define XHCI_U2_DISABLE_WAKE (1 << 27) #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28) +#define XHCI_SUSPEND_DELAY (1 << 30) unsigned int num_active_eps; unsigned int limit_active_eps; /* There are two roothubs to keep track of bus suspend info for */