Commit a1e4d72c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM: Allow PCI devices to suspend/resume asynchronously

Set power.async_suspend for all PCI devices and PCIe port services,
so that they can be suspended and resumed in parallel with other
devices they don't depend on in a known way (i.e. devices which are
not their parents or children).

This only affects the "regular" suspend and resume stages, which
means in particular that the restoration of the PCI devices' standard
configuration registers during resume will still be carried out
synchronously (at the "early" resume stage).
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 09c09bc6
...@@ -1540,6 +1540,7 @@ void pci_pm_init(struct pci_dev *dev) ...@@ -1540,6 +1540,7 @@ void pci_pm_init(struct pci_dev *dev)
int pm; int pm;
u16 pmc; u16 pmc;
device_enable_async_suspend(&dev->dev);
dev->wakeup_prepared = false; dev->wakeup_prepared = false;
dev->pm_cap = 0; dev->pm_cap = 0;
......
...@@ -285,6 +285,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq) ...@@ -285,6 +285,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
pci_name(pdev), pci_name(pdev),
get_descriptor_id(pdev->pcie_type, service)); get_descriptor_id(pdev->pcie_type, service));
device->parent = &pdev->dev; device->parent = &pdev->dev;
device_enable_async_suspend(device);
retval = device_register(device); retval = device_register(device);
if (retval) if (retval)
......
...@@ -1436,6 +1436,7 @@ struct pci_bus * pci_create_bus(struct device *parent, ...@@ -1436,6 +1436,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
if (error) if (error)
goto dev_reg_err; goto dev_reg_err;
b->bridge = get_device(dev); b->bridge = get_device(dev);
device_enable_async_suspend(b->bridge);
if (!parent) if (!parent)
set_dev_node(b->bridge, pcibus_to_node(b)); set_dev_node(b->bridge, pcibus_to_node(b));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment