]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
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 | |
5 | Patch-mainline: 2.6.29 | |
6 | References: bnc#438941 | |
7 | ||
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. | |
13 | ||
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> | |
17 | ||
18 | ||
19 | --- | |
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(-) | |
24 | ||
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); | |
36 | ||
37 | --- a/drivers/pci/pcie/aspm.c | |
38 | +++ b/drivers/pci/pcie/aspm.c | |
39 | @@ -944,24 +944,15 @@ void pcie_no_aspm(void) | |
40 | aspm_disabled = 1; | |
41 | } | |
42 | ||
43 | -#ifdef CONFIG_ACPI | |
44 | -#include <acpi/acpi_bus.h> | |
45 | -#include <linux/pci-acpi.h> | |
46 | -static void pcie_aspm_platform_init(void) | |
47 | +/** | |
48 | + * pcie_aspm_enabled - is PCIe ASPM enabled? | |
49 | + * | |
50 | + * Returns true if ASPM has not been disabled by the command-line option | |
51 | + * pcie_aspm=off. | |
52 | + **/ | |
53 | +int pcie_aspm_enabled(void) | |
54 | { | |
55 | - pcie_osc_support_set(OSC_ACTIVE_STATE_PWR_SUPPORT| | |
56 | - OSC_CLOCK_PWR_CAPABILITY_SUPPORT); | |
57 | + return !aspm_disabled; | |
58 | } | |
59 | -#else | |
60 | -static inline void pcie_aspm_platform_init(void) { } | |
61 | -#endif | |
62 | +EXPORT_SYMBOL(pcie_aspm_enabled); | |
63 | ||
64 | -static int __init pcie_aspm_init(void) | |
65 | -{ | |
66 | - if (aspm_disabled) | |
67 | - return 0; | |
68 | - pcie_aspm_platform_init(); | |
69 | - return 0; | |
70 | -} | |
71 | - | |
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); | |
77 | #endif | |
78 | ||
79 | +#ifndef CONFIG_PCIEASPM | |
80 | +static inline int pcie_aspm_enabled(void) | |
81 | +{ | |
82 | + return 0; | |
83 | +} | |
84 | +#else | |
85 | +extern int pcie_aspm_enabled(void); | |
86 | +#endif | |
87 | + | |
88 | #ifdef CONFIG_HT_IRQ | |
89 | /* The functions a driver should call */ | |
90 | int ht_create_irq(struct pci_dev *dev, int idx); |