aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci-aspm.h
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2011-11-10 16:38:33 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-12-05 13:21:45 -0500
commit3c076351c4027a56d5005a39a0b518a4ba393ce2 (patch)
tree8e9a2130983fde8ca0a4d03c5d970cf10beefa95 /include/linux/pci-aspm.h
parent69166fbf02c7a21745013f2de037bf7af26e4279 (diff)
PCI: Rework ASPM disable code
Right now we forcibly clear ASPM state on all devices if the BIOS indicates that the feature isn't supported. Based on the Microsoft presentation "PCI Express In Depth for Windows Vista and Beyond", I'm starting to think that this may be an error. The implication is that unless the platform grants full control via _OSC, Windows will not touch any PCIe features - including ASPM. In that case clearing ASPM state would be an error unless the platform has granted us that control. This patch reworks the ASPM disabling code such that the actual clearing of state is triggered by a successful handoff of PCIe control to the OS. The general ASPM code undergoes some changes in order to ensure that the ability to clear the bits isn't overridden by ASPM having already been disabled. Further, this theoretically now allows for situations where only a subset of PCIe roots hand over control, leaving the others in the BIOS state. It's difficult to know for sure that this is the right thing to do - there's zero public documentation on the interaction between all of these components. But enough vendors enable ASPM on platforms and then set this bit that it seems likely that they're expecting the OS to leave them alone. Measured to save around 5W on an idle Thinkpad X220. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci-aspm.h')
-rw-r--r--include/linux/pci-aspm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
index 7cea7b6c1413..c8320144fe79 100644
--- a/include/linux/pci-aspm.h
+++ b/include/linux/pci-aspm.h
@@ -29,7 +29,7 @@ extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); 29extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
30extern void pci_disable_link_state(struct pci_dev *pdev, int state); 30extern void pci_disable_link_state(struct pci_dev *pdev, int state);
31extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); 31extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
32extern void pcie_clear_aspm(void); 32extern void pcie_clear_aspm(struct pci_bus *bus);
33extern void pcie_no_aspm(void); 33extern void pcie_no_aspm(void);
34#else 34#else
35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) 35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
@@ -47,7 +47,7 @@ static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
47static inline void pci_disable_link_state(struct pci_dev *pdev, int state) 47static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
48{ 48{
49} 49}
50static inline void pcie_clear_aspm(void) 50static inline void pcie_clear_aspm(struct pci_bus *bus)
51{ 51{
52} 52}
53static inline void pcie_no_aspm(void) 53static inline void pcie_no_aspm(void)