aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-04-17 12:43:16 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-17 12:43:16 -0400
commit42c34707f9d24ef159cce87e4353babcf2b417a6 (patch)
treed7f94610311cd59885b8bcfec6d36bde93ccf22d /drivers/pci
parent723ec4d06cb2eed481436cfe008f5f63c45e88fd (diff)
parentffaddbe8f925a4f41eecb31e7fe69a9bdb6e2e59 (diff)
Merge branch 'pci/rafael-pm' into next
* pci/rafael-pm: PCI/PM: Make pci_pme_active() ignore devices without PME support PCI/PM: Fix fallback to PCI_D0 in pci_platform_power_transition()
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f0ef3997ed3b..a899d8bb190d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -646,15 +646,11 @@ static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state)
646 error = platform_pci_set_power_state(dev, state); 646 error = platform_pci_set_power_state(dev, state);
647 if (!error) 647 if (!error)
648 pci_update_current_state(dev, state); 648 pci_update_current_state(dev, state);
649 /* Fall back to PCI_D0 if native PM is not supported */ 649 } else
650 if (!dev->pm_cap)
651 dev->current_state = PCI_D0;
652 } else {
653 error = -ENODEV; 650 error = -ENODEV;
654 /* Fall back to PCI_D0 if native PM is not supported */ 651
655 if (!dev->pm_cap) 652 if (error && !dev->pm_cap) /* Fall back to PCI_D0 */
656 dev->current_state = PCI_D0; 653 dev->current_state = PCI_D0;
657 }
658 654
659 return error; 655 return error;
660} 656}
@@ -1575,7 +1571,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
1575{ 1571{
1576 u16 pmcsr; 1572 u16 pmcsr;
1577 1573
1578 if (!dev->pm_cap) 1574 if (!dev->pme_support)
1579 return; 1575 return;
1580 1576
1581 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); 1577 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
@@ -1924,6 +1920,7 @@ void pci_pm_init(struct pci_dev *dev)
1924 dev->wakeup_prepared = false; 1920 dev->wakeup_prepared = false;
1925 1921
1926 dev->pm_cap = 0; 1922 dev->pm_cap = 0;
1923 dev->pme_support = 0;
1927 1924
1928 /* find PCI PM capability in list */ 1925 /* find PCI PM capability in list */
1929 pm = pci_find_capability(dev, PCI_CAP_ID_PM); 1926 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
@@ -1975,8 +1972,6 @@ void pci_pm_init(struct pci_dev *dev)
1975 device_set_wakeup_capable(&dev->dev, true); 1972 device_set_wakeup_capable(&dev->dev, true);
1976 /* Disable the PME# generation functionality */ 1973 /* Disable the PME# generation functionality */
1977 pci_pme_active(dev, false); 1974 pci_pme_active(dev, false);
1978 } else {
1979 dev->pme_support = 0;
1980 } 1975 }
1981} 1976}
1982 1977