Received: by 10.213.65.68 with SMTP id h4csp486291imn; Fri, 16 Mar 2018 09:11:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELvuBMpBYBrzOoTi1hPCJFFLvaiqCzrubX8WL099dc7wpkDtJJPEsZm9RWHPHKen/g716S8A X-Received: by 10.98.247.9 with SMTP id h9mr2033696pfi.212.1521216698456; Fri, 16 Mar 2018 09:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216698; cv=none; d=google.com; s=arc-20160816; b=D342SidWF/xpdn1NOwPeA271bx7QHHvSx3d7GoniGP3IxS+jzZdCoBi4l9RNL6W2Rc W+6h6e2ulpTnL2BCe64eDjI0SEXA0wyRZ3N8n4PaUNxnT3Xah9/N+FcmZnRQOtNcz9jR o4YwTmIqIgrHTdS3RdrrZHcII4hKq7cvhKQmRwjvLwp95CGsVtLy54LG9L4hBS1AZO62 dfobDOaBuZo0DMkgKaBsLYtF4SbOvXmvdNTp1GKmXxJuOYz0Nte/M4w8DH1x2WbXq2cq P+BWQYN+3M/s5CFHZsd5M+/GsH12zEnQ4+J2N743+R5MLcE07ZBV1LSlgx9qSehhq7+T iROQ== 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=TFQxyXjg3YjXEU5vW0tIgtk/ELyGvELga/P+B+N3Uv0=; b=UcqplIgIDchOMF9cpfhie4wjKokiWjwR0LaEh8WFo83djV7/yUQ4uWHTVfYABDmW2I 0pJ9WWHrkOD7suoIF53HtwQwCvfRXKPGyOWDe2rDywFASWVdfo8tt4HWHjAe7539Ux3e MpwSHSavwJKrXhuaEgX0BCvVnXFp9uJaa8CeuVKp7rjg57QERPTto/QEUJ9sD5KABA1m +8ercBTN1x/xW10nZtGWo/sDTDyVlaOgH8JaIhut3oatuXHuAw9Vscfn4ObyNS8UP3SL eNl056JZ7CJ5gHZIMmANiOh+QgwvNPfeCOBwJkRvO+YKw6LtADcdyg0V25RQCVAtUcQk 8YgA== 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 y16si73710pge.500.2018.03.16.09.11.23; Fri, 16 Mar 2018 09:11:38 -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 S934489AbeCPQKQ (ORCPT + 99 others); Fri, 16 Mar 2018 12:10:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43802 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965115AbeCPPkx (ORCPT ); Fri, 16 Mar 2018 11:40:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5FF11EE3; Fri, 16 Mar 2018 15:40:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Mathias Nyman Subject: [PATCH 4.15 007/128] xhci: Fix front USB ports on ASUS PRIME B350M-A Date: Fri, 16 Mar 2018 16:22:28 +0100 Message-Id: <20180316152336.578509710@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-stable 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- 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 @@ -122,6 +122,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 @@ -880,6 +880,9 @@ int xhci_suspend(struct xhci_hcd *xhci, 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); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1823,6 +1823,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;