]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
PM: Allow PCI devices to suspend/resume asynchronously
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 8 Feb 2010 18:16:33 +0000 (19:16 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 26 Feb 2010 19:39:12 +0000 (20:39 +0100)
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: Rafael J. Wysocki <rjw@sisk.pl>
drivers/pci/pci.c
drivers/pci/pcie/portdrv_core.c
drivers/pci/probe.c

index f4a2738bf0bf740ed96dd54b9efce8eea2c19a74..2b9ac9e594afcfcb3a2aaa797e9bbc07e54f921e 100644 (file)
@@ -1540,6 +1540,7 @@ void pci_pm_init(struct pci_dev *dev)
        int pm;
        u16 pmc;
 
+       device_enable_async_suspend(&dev->dev);
        dev->wakeup_prepared = false;
        dev->pm_cap = 0;
 
index 0d34ff4153998ca823ebf7b928b428e165691f3a..e73effbe402c55e82be4d8a821b3d39e64f96bac 100644 (file)
@@ -285,6 +285,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
                     pci_name(pdev),
                     get_descriptor_id(pdev->pcie_type, service));
        device->parent = &pdev->dev;
+       device_enable_async_suspend(device);
 
        retval = device_register(device);
        if (retval)
index 270d069819f7070a9a27f9bdf36e8961e2f67e7e..2a943090a3b7838b3a8fcb86a9caa89dfe611133 100644 (file)
@@ -1436,6 +1436,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
        if (error)
                goto dev_reg_err;
        b->bridge = get_device(dev);
+       device_enable_async_suspend(b->bridge);
 
        if (!parent)
                set_dev_node(b->bridge, pcibus_to_node(b));