Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp821680ybl; Wed, 11 Dec 2019 08:02:34 -0800 (PST) X-Google-Smtp-Source: APXvYqx+I4/4lcRTZ5c8PWLw5uVbKM4KnsoobKnppLQFRBIOzvoZAss8zB9N/OpeyIBsLmzzWTNY X-Received: by 2002:a05:6830:1e75:: with SMTP id m21mr2749521otr.36.1576080154500; Wed, 11 Dec 2019 08:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080154; cv=none; d=google.com; s=arc-20160816; b=ImzTRH15AIqp0K03hfoy8LGlkLbDYVkQ5/5gc9srVHa+EvHRW+uwFUVmFvEQc9VnH6 pgWmPfVQtyOCdsQTaY8EmUDwD3tto6PfLWghleR7DWYigVbBBJUCwq3v28zMmTXQyKPo geIH2c4BM+EFKiB6VHddPaoFQxxc7xkm9svIqVIeDg6scpkG0mS9/hLJZCt7LbS7rvPT ba0GzMpc4QzzFUIHbjDH0abKcbNN4W1UalrpDrE8q58qe5HvORUwZ3bl2yfALbyE9JQ4 VI3dQI+1qFF0PQfQ4OHgcNcboAKAUGT5myCRnzZK1AV7NV0K+UmOQcLG0be/v2/186t5 ou1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RaRj4P+QO4eOnYqCmEFEFYQpTU1Jp+lmibgqbhiTxag=; b=kXrszYpltm/vc7x/Eh87DCBr+6joo8MW82Y2UX5gxKmT33wGjZrpwitTj2FYdb+1za 0/58tXiSi485aLzLFYLJrrfL1xuGfrZxuGRrea5c/P4u7zRaCryflDSCmEEEBisHrW2k f8ipkcTlWNV41KpiiBuwLphww39IDfabZeeKOwUd48q86fzgiGvMbHzUm+t6MKE4nI71 Ta/zGNeH/ys33oX8Vv0fDn+ahz3AUrOjHZGQYXISgmynz2WL8ICJx7ldoFy6MlZReg6z PxBC7d2g6zkSjX+3eBA9ccu0vtHl5awdOyGZPIamhU1v7QzDPahhfILqC7a46+zk0Z1c El3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DOLJFUuq; 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 e10si1131748oti.61.2019.12.11.08.02.00; Wed, 11 Dec 2019 08:02:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=DOLJFUuq; 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 S1732493AbfLKQAu (ORCPT + 99 others); Wed, 11 Dec 2019 11:00:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:37588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731479AbfLKPNl (ORCPT ); Wed, 11 Dec 2019 10:13:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B4BB24658; Wed, 11 Dec 2019 15:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077220; bh=bOEKlkM0Bu6aFMQUWVJmuPimpJcF6y2YbSZcnZpYxnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOLJFUuqBAKMeMDQD0Xo8dFKAi10dRDDRgE8MD2GK7ujs5k0GQ60ZKcRCsq1ULCd7 tvEnAQFV0omvyQ12fE+w1t6J7ZjTkv0HsX0y/IEEQbPUAj/DtKnf8sXa7KU4kV8D3W 67BZa2I2YWs1F4U1pfrzEirDF4dRsbXunFCWNJ9g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Bjorn Helgaas Subject: [PATCH 5.3 063/105] x86/PCI: Avoid AMD FCH XHCI USB PME# from D0 defect Date: Wed, 11 Dec 2019 16:05:52 +0100 Message-Id: <20191211150246.810282645@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng commit 7e8ce0e2b036dbc6617184317983aea4f2c52099 upstream. The AMD FCH USB XHCI Controller advertises support for generating PME# while in D0. When in D0, it does signal PME# for USB 3.0 connect events, but not for USB 2.0 or USB 1.1 connect events, which means the controller doesn't wake correctly for those events. 00:10.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller [1022:7914] (rev 20) (prog-if 30 [XHCI]) Subsystem: Dell FCH USB XHCI Controller [1028:087e] Capabilities: [50] Power Management version 3 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Clear PCI_PM_CAP_PME_D0 in dev->pme_support to indicate the device will not assert PME# from D0 so we don't rely on it. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203673 Link: https://lore.kernel.org/r/20190902145252.32111-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/pci/fixup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -589,6 +589,17 @@ static void pci_fixup_amd_ehci_pme(struc DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7808, pci_fixup_amd_ehci_pme); /* + * Device [1022:7914] + * When in D0, PME# doesn't get asserted when plugging USB 2.0 device. + */ +static void pci_fixup_amd_fch_xhci_pme(struct pci_dev *dev) +{ + dev_info(&dev->dev, "PME# does not work under D0, disabling it\n"); + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT); +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7914, pci_fixup_amd_fch_xhci_pme); + +/* * Apple MacBook Pro: Avoid [mem 0x7fa00000-0x7fbfffff] * * Using the [mem 0x7fa00000-0x7fbfffff] region, e.g., by assigning it to