Skip to content

Commit f19dc04

Browse files
committed
PCI/PM: Set power.strict_midlayer in pci_pm_init()
The PCI bus type does not expect its runtime PM suspend callback function, pci_pm_runtime_suspend(), to be invoked at all during system- wide suspend and resume, and it does not expect its runtime resume callback function, pci_pm_runtime_resume(), to be invoked at any point when runtime PM is disabled for the given device during system-wide suspend and resume, so make it express that expectation by setting power.strict_midlayer for all PCI devices in pci_pm_prepare() and clear it in pci_pm_complete(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://patch.msgid.link/1925097.atdPhlSkOF@rjwysocki.net
1 parent 325e377 commit f19dc04

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/pci/pci-driver.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,8 @@ static int pci_pm_prepare(struct device *dev)
708708
struct pci_dev *pci_dev = to_pci_dev(dev);
709709
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
710710

711+
dev_pm_set_strict_midlayer(dev, true);
712+
711713
if (pm && pm->prepare) {
712714
int error = pm->prepare(dev);
713715
if (error < 0)
@@ -749,6 +751,8 @@ static void pci_pm_complete(struct device *dev)
749751
if (pci_dev->current_state < pre_sleep_state)
750752
pm_request_resume(dev);
751753
}
754+
755+
dev_pm_set_strict_midlayer(dev, false);
752756
}
753757

754758
#else /* !CONFIG_PM_SLEEP */

0 commit comments

Comments
 (0)