[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191014230016.240912-5-helgaas@kernel.org>
Date: Mon, 14 Oct 2019 18:00:13 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Dexuan Cui <decui@...rosoft.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Michael Kelley <mikelley@...rosoft.com>,
Sasha Levin <Alexander.Levin@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>, olaf@...fle.de,
apw@...onical.com, jasowang@...hat.com, vkuznets@...hat.com,
marcelo.cerri@...onical.com, jackm@...lanox.com,
linux-pci@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org,
driverdev-devel@...uxdriverproject.org,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: [PATCH 4/7] PCI/PM: Run resume fixups before disabling wakeup events
From: Bjorn Helgaas <bhelgaas@...gle.com>
pci_pm_resume() and pci_pm_restore() call pci_pm_default_resume(), which
runs resume fixups before disabling wakeup events:
static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);
pci_enable_wake(pci_dev, PCI_D0, false);
}
pci_pm_runtime_resume() does both of these, but in the opposite order:
pci_enable_wake(pci_dev, PCI_D0, false);
pci_fixup_device(pci_fixup_resume, pci_dev);
We should always use the same ordering unless there's a reason to do
otherwise. Change pci_pm_runtime_resume() to call pci_pm_default_resume()
instead of open-coding this, so the fixups are always done before disabling
wakeup events.
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
---
drivers/pci/pci-driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 0c3086793e4e..55acb658273f 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1345,8 +1345,7 @@ static int pci_pm_runtime_resume(struct device *dev)
return 0;
pci_fixup_device(pci_fixup_resume_early, pci_dev);
- pci_enable_wake(pci_dev, PCI_D0, false);
- pci_fixup_device(pci_fixup_resume, pci_dev);
+ pci_pm_default_resume(pci_dev);
if (pm && pm->runtime_resume)
rc = pm->runtime_resume(dev);
--
2.23.0.700.g56cf767bdb-goog
Powered by blists - more mailing lists