Received: by 10.223.185.116 with SMTP id b49csp4686154wrg; Tue, 6 Mar 2018 22:15:17 -0800 (PST) X-Google-Smtp-Source: AG47ELuyOiVKDvjo3/foD3sLbIAzAOQSa5VBMgga2yB7qrKJDtN3qqKboej/7igZquunRjK5YQdC X-Received: by 2002:a17:902:6a8c:: with SMTP id n12-v6mr15239730plk.230.1520403316987; Tue, 06 Mar 2018 22:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520403316; cv=none; d=google.com; s=arc-20160816; b=ZdTcNidDQ7TpvIwuwiTSQb+0sOvpR/wUZQeAoZKRVCdKDl6DCLgb39t4o+YN8clE8i pDf+E3frFaC+qYVTqQvQzAUHQ9mBqbozb81uCMo56/AxMv/vexMxFTqKTonB+mKxub+j 2jCedzfJBuTcXJQEyDM3X9rbzbZaOWat57/FD4MT5NWK68Ro4lw3jJhgCOUimyHDaNtb XWeJhoK/InKFGA/ihpkduiKk/SzaeTZVhu2AResg00X31RyZE6Wqkq/+CF9TQBs+IEUL rlJOG0JS4/zjG8MD+fihsag2vanA0tgBPEWWwMiY3fVfvRiKoP/XS4MPTPC2lXVU5Grs LJxA== 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:cc:to:from :subject:dmarc-filter:arc-authentication-results; bh=PhJJCFqnTy7uK4UNf6S5MxRNDNbFfaDbMLFzHqOLU1o=; b=BkvtMfPE8QrHWoIk5ViGlsizkNxS3c37ctGo46MWAV7ROvVdME5jlTT+XBVJlnCU+9 OIiDvxdPw0BoCZOEqAxAt7Gmdi0iZYRmGPmnlUb5pseN2YlpUUX9WdUmKz1vNifAsJhG TPLyoDBPyqKgjLm+F8cp13VT+1y5ls2qv15iiuSlw5sC8fyyuzPrxHNOZJGfK1OkJ/CF W3ssllkqAEmrOLtnOm7aCiZWPYLTelZAk6h/MHo9pW91emGmyioTYOHlrvwomJG39IgK 7NhYibfppbTU/zTUrCI7vEz+rG6qjJLypYUQ7Zn6HQQdOeYlqOoqguJqcFE59UmSlBz/ QAVQ== 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 u17si11015914pgv.116.2018.03.06.22.15.03; Tue, 06 Mar 2018 22:15:16 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbeCGGNo (ORCPT + 99 others); Wed, 7 Mar 2018 01:13:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:42488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbeCGGNl (ORCPT ); Wed, 7 Mar 2018 01:13:41 -0500 Received: from localhost (unknown [50.35.13.28]) (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 93C7D2178B; Wed, 7 Mar 2018 06:13:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93C7D2178B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH v1 3/9] PCI/PM: Clear PCIe PME Status bit for Root Complex Event Collectors From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Keith Busch , Sinan Kaya , Lukas Wunner Date: Wed, 07 Mar 2018 00:13:40 -0600 Message-ID: <152040322027.240786.13965159319024774656.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152040297576.240786.1532465558381209070.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152040297576.240786.1532465558381209070.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas Per PCIe r4.0, sec 6.1.6, Root Complex Event Collectors can generate PME interrupts on behalf of Root Complex Integrated Endpoints. Linux does not currently enable PME interrupts from RC Event Collectors, but fe31e69740ed ("PCI/PCIe: Clear Root PME Status bits early during system resume") suggests PME interrupts may be enabled by the platform for ACPI- based runtime wakeup. Clear the PCIe PME Status bit for Root Complex Event Collectors during resume, just like we already do for Root Ports. If the BIOS enables PME interrupts for an event collector and neglects to clear the status bit on resume, this change should fix the same bug as fe31e69740ed (PMEs not working after waking from a sleep state), but for Root Complex Integrated Endpoints. Signed-off-by: Bjorn Helgaas --- drivers/pci/pci-driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index bf0704b75f79..38ee7c8b4d1a 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -533,7 +533,8 @@ static void pcie_resume_early(struct pci_dev *pci_dev) * bits now just in case (shouldn't hurt). */ if (pci_is_pcie(pci_dev) && - pci_pcie_type(pci_dev) == PCI_EXP_TYPE_ROOT_PORT) + (pci_pcie_type(pci_dev) == PCI_EXP_TYPE_ROOT_PORT || + pci_pcie_type(pci_dev) == PCI_EXP_TYPE_RC_EC)) pcie_clear_root_pme_status(pci_dev); }