aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-11-26 15:00:57 -0500
committerBjorn Helgaas <bhelgaas@google.com>2012-11-26 15:00:57 -0500
commitd3fe3988fb24e5ed13b2243b789a652882d3b26c (patch)
tree1257424a712583bf474cb0831621a47e73dfc3de /drivers/pci/pci.c
parent7db78a9c864d1baf916d849febef31e274cfcb1f (diff)
parentff8e59bc4ec3f31789a47dce9b6fe44bd7bc5fcc (diff)
Merge branch 'for-linus' into next
* for-linus: PCI/portdrv: Don't create hotplug slots unless port supports hotplug PCI/PM: Fix proc config reg access for D3cold and bridge suspending PCI/PM: Resume device before shutdown PCI/PM: Fix deadlock when unbinding device if parent in D3cold
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 05a510d1bb30..adffc6f621e5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1868,6 +1868,38 @@ bool pci_dev_run_wake(struct pci_dev *dev)
1868} 1868}
1869EXPORT_SYMBOL_GPL(pci_dev_run_wake); 1869EXPORT_SYMBOL_GPL(pci_dev_run_wake);
1870 1870
1871void pci_config_pm_runtime_get(struct pci_dev *pdev)
1872{
1873 struct device *dev = &pdev->dev;
1874 struct device *parent = dev->parent;
1875
1876 if (parent)
1877 pm_runtime_get_sync(parent);
1878 pm_runtime_get_noresume(dev);
1879 /*
1880 * pdev->current_state is set to PCI_D3cold during suspending,
1881 * so wait until suspending completes
1882 */
1883 pm_runtime_barrier(dev);
1884 /*
1885 * Only need to resume devices in D3cold, because config
1886 * registers are still accessible for devices suspended but
1887 * not in D3cold.
1888 */
1889 if (pdev->current_state == PCI_D3cold)
1890 pm_runtime_resume(dev);
1891}
1892
1893void pci_config_pm_runtime_put(struct pci_dev *pdev)
1894{
1895 struct device *dev = &pdev->dev;
1896 struct device *parent = dev->parent;
1897
1898 pm_runtime_put(dev);
1899 if (parent)
1900 pm_runtime_put_sync(parent);
1901}
1902
1871/** 1903/**
1872 * pci_pm_init - Initialize PM functions of given PCI device 1904 * pci_pm_init - Initialize PM functions of given PCI device
1873 * @dev: PCI device to handle. 1905 * @dev: PCI device to handle.