1 From 3e1b16002af29758b6bc9c38939d43838d9335bc Mon Sep 17 00:00:00 2001
2 From: Andrew Patterson <andrew.patterson@hp.com>
3 Date: Mon, 10 Nov 2008 15:30:55 -0700
4 Subject: ACPI/PCI: PCIe ASPM _OSC support capabilities called when root bridge added
8 The _OSC capabilities OSC_ACTIVE_STATE_PWR_SUPPORT and
9 OSC_CLOCK_PWR_CAPABILITY_SUPPORT are set when the root bridge is added
10 with pci_acpi_osc_support(), so we no longer need to do it in the ASPM
11 driver. Also add the function pcie_aspm_enabled, which returns true if
12 pcie_aspm=off is not on the kernel command-line.
14 Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
15 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 drivers/acpi/pci_root.c | 3 +++
21 drivers/pci/pcie/aspm.c | 27 +++++++++------------------
22 include/linux/pci.h | 9 +++++++++
23 3 files changed, 21 insertions(+), 18 deletions(-)
25 --- a/drivers/acpi/pci_root.c
26 +++ b/drivers/acpi/pci_root.c
27 @@ -347,6 +347,9 @@ static int __devinit acpi_pci_root_add(s
28 /* Indicate support for various _OSC capabilities. */
29 if (pci_ext_cfg_avail(root->bus->self))
30 flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
31 + if (pcie_aspm_enabled())
32 + flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
33 + OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
34 if (flags != base_flags)
35 pci_acpi_osc_support(device->handle, flags);
37 --- a/drivers/pci/pcie/aspm.c
38 +++ b/drivers/pci/pcie/aspm.c
39 @@ -948,24 +948,15 @@ void pcie_no_aspm(void)
44 -#include <acpi/acpi_bus.h>
45 -#include <linux/pci-acpi.h>
46 -static void pcie_aspm_platform_init(void)
48 + * pcie_aspm_enabled - is PCIe ASPM enabled?
50 + * Returns true if ASPM has not been disabled by the command-line option
53 +int pcie_aspm_enabled(void)
55 - pcie_osc_support_set(OSC_ACTIVE_STATE_PWR_SUPPORT|
56 - OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
57 + return !aspm_disabled;
60 -static inline void pcie_aspm_platform_init(void) { }
62 +EXPORT_SYMBOL(pcie_aspm_enabled);
64 -static int __init pcie_aspm_init(void)
68 - pcie_aspm_platform_init();
72 -fs_initcall(pcie_aspm_init);
73 --- a/include/linux/pci.h
74 +++ b/include/linux/pci.h
75 @@ -779,6 +779,15 @@ extern void msi_remove_pci_irq_vectors(s
76 extern void pci_restore_msi_state(struct pci_dev *dev);
79 +#ifndef CONFIG_PCIEASPM
80 +static inline int pcie_aspm_enabled(void)
85 +extern int pcie_aspm_enabled(void);
89 /* The functions a driver should call */
90 int ht_create_irq(struct pci_dev *dev, int idx);