diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-03 17:43:21 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-03 17:43:21 +0300 |
commit | 3f4f35678fb83da2f9ef17ddaa7507a45c2f7049 (patch) | |
tree | bf73ab51e0e7a9847e94fbcae1323c83aa81ed7c /drivers/pci/pci-driver.c | |
parent | 6c6cba49495c3a254c1bc922afeb69e1431d2c23 (diff) | |
parent | a0d2a959d3da343554523d26902de1d40a9e5c28 (diff) | |
download | linux-3f4f35678fb83da2f9ef17ddaa7507a45c2f7049.tar.xz |
Merge branch 'pci/pm' into next
* pci/pm:
PCI: Avoid unnecessary resume after direct-complete
PCI: Recognize D3cold in pci_update_current_state()
PCI: Query platform firmware for device power state
PCI: Afford direct-complete to devices with non-standard PM
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index edd78e04b693..1ccce1cd6aca 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -682,8 +682,19 @@ static int pci_pm_prepare(struct device *dev) static void pci_pm_complete(struct device *dev) { - pci_dev_complete_resume(to_pci_dev(dev)); - pm_complete_with_resume_check(dev); + struct pci_dev *pci_dev = to_pci_dev(dev); + + pci_dev_complete_resume(pci_dev); + pm_generic_complete(dev); + + /* Resume device if platform firmware has put it in reset-power-on */ + if (dev->power.direct_complete && pm_resume_via_firmware()) { + pci_power_t pre_sleep_state = pci_dev->current_state; + + pci_update_current_state(pci_dev, pci_dev->current_state); + if (pci_dev->current_state < pre_sleep_state) + pm_request_resume(dev); + } } #else /* !CONFIG_PM_SLEEP */ |