From patchwork Wed Mar 28 13:47:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10313319 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D6C160383 for ; Wed, 28 Mar 2018 13:47:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BA0826255 for ; Wed, 28 Mar 2018 13:47:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F32AA26E5D; Wed, 28 Mar 2018 13:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B8BE26255 for ; Wed, 28 Mar 2018 13:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138AbeC1Nrx (ORCPT ); Wed, 28 Mar 2018 09:47:53 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:49621 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753098AbeC1Nrw (ORCPT ); Wed, 28 Mar 2018 09:47:52 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MAysS-1etVvk2G84-00A1IQ; Wed, 28 Mar 2018 15:47:48 +0200 From: Arnd Bergmann To: Bjorn Helgaas Cc: Arnd Bergmann , "Rafael J. Wysocki" , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pci: move pcie_pme_root_status_cleanup into SUSPEND section Date: Wed, 28 Mar 2018 15:47:18 +0200 Message-Id: <20180328134747.2062348-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ivlY+y94Cpqa814dri0L2TTX32s9nxpO4i6aQLS13z0NJpHD6QV X6qlQsTmpmWr+ciggIaUUD3hT87IXKVykHebBtl8TftqyZFOC2sO0Kp1zpPBHmTlBQfcY3z YdPnAbuH1kFNjHn1tcnjR2vgUIzctVbUnI3atZeIzlq8v8hjwgKGxg2Q6oqMcet6r4ZzFff 240OFmwVTRnafvYnxbbxg== X-UI-Out-Filterresults: notjunk:1; V01:K0:TFI0PRQpRiY=:hvLAJYJ3WDL+rzpN6AQpI+ V1YgK7bMRprmeS/s35wu6zduNoIIxieKIeRgyjBu3yIcjZNmbqEMekls2e3OhkjVAvFGcsuup Nxh7RohABfSITqAhkZjx1YZsO01b/kAD0w5i555wgAsjRUZRRizWtk1eIstd5C447N9mApLcx ng+j0PLOXTsL0PgKK9cXTZ+QwKis8wJJ6I5AehmVAm9OJMo4GYfX3wjuMuU2S6WHEN7d9TB6C f/e/MKwQ4KUyKopELUVsCcl9qsTKJ6RemG58LPq6VIATvZyE7Z1BETXJsJbI+AePCyYyD06+Z CqQC6uYh92lAhsyyBUGzsjRhjgX6+fW55/zIr5qRfrFYJ4HZekyEDbpSM1HwKQPodqA2a9fiC 6plfh8YqxHcG+R/dlB92mFPTVDGmw6p25kkJpK+aox15bpmjz8pauvsGSYSVtEd448hUwZtSG Xbc4TUqOxS0p8cPVNPVNIocWOxBsxWEhPMLzwVsVaABgTcu9Ajzjdo1/LE9C73beV9D4rJPTz 5ODdhzoMy94m0KSuZrW4/eX2PMMWAcxgHzf+5NgPJBByD7ZeLAYdnEHqzOR8JDEVdi+i2kjs3 Z+pgEDQ5mtCpDs4FSu9z4aPnoKWS7qMYDgUZYZ2cAJMWdf4zYysmKKDgvtZOx2+AKyZEiKyUs hfYIiFm1AuFTO/kVEj2k0q5b4kDfm6NxWayYMdooxmyC/8AzC9WoyyO1PRwAPsowvkGTySZ5C o2rRp7y0k/gEbdZ3Q8qbh2/etSeIYzYBaHhojg== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The power management code in pci-driver.c is a maze of #ifdefs, and the newly added pcie_pme_root_status_cleanup function ended up in the wrong one of them, causing a harmless warning in some configurations: drivers/pci/pci-driver.c:527:13: error: 'pcie_pme_root_status_cleanup' defined but not used [-Werror=unused-function] static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This moves the definition into the correct #ifdef section. Fixes: 6c4dfc1389e1 ("PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver") Signed-off-by: Arnd Bergmann Reviewed-by: Rafael J. Wysocki --- drivers/pci/pci-driver.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b9bca74e9eff..6ace47099fc5 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -524,19 +524,6 @@ static void pci_pm_default_resume_early(struct pci_dev *pci_dev) pci_fixup_device(pci_fixup_resume_early, pci_dev); } -static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) -{ - /* - * Some BIOSes forget to clear Root PME Status bits after system - * wakeup, which breaks ACPI-based runtime wakeup on PCI Express. - * Clear those 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_RC_EC)) - pcie_clear_root_pme_status(pci_dev); -} - /* * Default "suspend" method for devices that have no driver provided suspend, * or not even a driver at all (second part). @@ -726,6 +713,18 @@ static void pci_pm_complete(struct device *dev) #endif /* !CONFIG_PM_SLEEP */ #ifdef CONFIG_SUSPEND +static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) +{ + /* + * Some BIOSes forget to clear Root PME Status bits after system + * wakeup, which breaks ACPI-based runtime wakeup on PCI Express. + * Clear those 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_RC_EC)) + pcie_clear_root_pme_status(pci_dev); +} static int pci_pm_suspend(struct device *dev) {