diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d88edf5c563b..af0cc3456dc1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1801,7 +1801,11 @@ static void __pci_pme_active(struct pci_dev *dev, bool enable) | |||
1801 | pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pmcsr); | 1801 | pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pmcsr); |
1802 | } | 1802 | } |
1803 | 1803 | ||
1804 | static void pci_pme_restore(struct pci_dev *dev) | 1804 | /** |
1805 | * pci_pme_restore - Restore PME configuration after config space restore. | ||
1806 | * @dev: PCI device to update. | ||
1807 | */ | ||
1808 | void pci_pme_restore(struct pci_dev *dev) | ||
1805 | { | 1809 | { |
1806 | u16 pmcsr; | 1810 | u16 pmcsr; |
1807 | 1811 | ||
@@ -1811,6 +1815,7 @@ static void pci_pme_restore(struct pci_dev *dev) | |||
1811 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); | 1815 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); |
1812 | if (dev->wakeup_prepared) { | 1816 | if (dev->wakeup_prepared) { |
1813 | pmcsr |= PCI_PM_CTRL_PME_ENABLE; | 1817 | pmcsr |= PCI_PM_CTRL_PME_ENABLE; |
1818 | pmcsr &= ~PCI_PM_CTRL_PME_STATUS; | ||
1814 | } else { | 1819 | } else { |
1815 | pmcsr &= ~PCI_PM_CTRL_PME_ENABLE; | 1820 | pmcsr &= ~PCI_PM_CTRL_PME_ENABLE; |
1816 | pmcsr |= PCI_PM_CTRL_PME_STATUS; | 1821 | pmcsr |= PCI_PM_CTRL_PME_STATUS; |
@@ -1907,14 +1912,9 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) | |||
1907 | { | 1912 | { |
1908 | int ret = 0; | 1913 | int ret = 0; |
1909 | 1914 | ||
1910 | /* | 1915 | /* Don't do the same thing twice in a row for one device. */ |
1911 | * Don't do the same thing twice in a row for one device, but restore | 1916 | if (!!enable == !!dev->wakeup_prepared) |
1912 | * PME Enable in case it has been updated by config space restoration. | ||
1913 | */ | ||
1914 | if (!!enable == !!dev->wakeup_prepared) { | ||
1915 | pci_pme_restore(dev); | ||
1916 | return 0; | 1917 | return 0; |
1917 | } | ||
1918 | 1918 | ||
1919 | /* | 1919 | /* |
1920 | * According to "PCI System Architecture" 4th ed. by Tom Shanley & Don | 1920 | * According to "PCI System Architecture" 4th ed. by Tom Shanley & Don |