/[linux-patches]/genpatches-2.6/tags/3.0-30/1019_linux-3.0.20.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1019_linux-3.0.20.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (22 months, 1 week ago) by mpagano
File size: 6661 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 1e57901..c060c58 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 19
9 +SUBLEVEL = 20
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
14 index d06078d..dfafecb 100644
15 --- a/drivers/acpi/pci_root.c
16 +++ b/drivers/acpi/pci_root.c
17 @@ -595,6 +595,13 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
18 if (ACPI_SUCCESS(status)) {
19 dev_info(root->bus->bridge,
20 "ACPI _OSC control (0x%02x) granted\n", flags);
21 + if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
22 + /*
23 + * We have ASPM control, but the FADT indicates
24 + * that it's unsupported. Clear it.
25 + */
26 + pcie_clear_aspm(root->bus);
27 + }
28 } else {
29 dev_info(root->bus->bridge,
30 "ACPI _OSC request failed (%s), "
31 diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
32 index d36f41e..56b04bc 100644
33 --- a/drivers/pci/pci-acpi.c
34 +++ b/drivers/pci/pci-acpi.c
35 @@ -393,7 +393,6 @@ static int __init acpi_pci_init(void)
36
37 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
38 printk(KERN_INFO"ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n");
39 - pcie_clear_aspm();
40 pcie_no_aspm();
41 }
42
43 diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
44 index 6892601..e25af67 100644
45 --- a/drivers/pci/pcie/aspm.c
46 +++ b/drivers/pci/pcie/aspm.c
47 @@ -68,7 +68,7 @@ struct pcie_link_state {
48 struct aspm_latency acceptable[8];
49 };
50
51 -static int aspm_disabled, aspm_force, aspm_clear_state;
52 +static int aspm_disabled, aspm_force;
53 static bool aspm_support_enabled = true;
54 static DEFINE_MUTEX(aspm_lock);
55 static LIST_HEAD(link_list);
56 @@ -500,9 +500,6 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
57 int pos;
58 u32 reg32;
59
60 - if (aspm_clear_state)
61 - return -EINVAL;
62 -
63 /*
64 * Some functions in a slot might not all be PCIe functions,
65 * very strange. Disable ASPM for the whole slot
66 @@ -574,9 +571,6 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
67 pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
68 return;
69
70 - if (aspm_disabled && !aspm_clear_state)
71 - return;
72 -
73 /* VIA has a strange chipset, root port is under a bridge */
74 if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT &&
75 pdev->bus->self)
76 @@ -608,7 +602,7 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
77 * the BIOS's expectation, we'll do so once pci_enable_device() is
78 * called.
79 */
80 - if (aspm_policy != POLICY_POWERSAVE || aspm_clear_state) {
81 + if (aspm_policy != POLICY_POWERSAVE) {
82 pcie_config_aspm_path(link);
83 pcie_set_clkpm(link, policy_to_clkpm_state(link));
84 }
85 @@ -649,8 +643,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
86 struct pci_dev *parent = pdev->bus->self;
87 struct pcie_link_state *link, *root, *parent_link;
88
89 - if ((aspm_disabled && !aspm_clear_state) || !pci_is_pcie(pdev) ||
90 - !parent || !parent->link_state)
91 + if (!pci_is_pcie(pdev) || !parent || !parent->link_state)
92 return;
93 if ((parent->pcie_type != PCI_EXP_TYPE_ROOT_PORT) &&
94 (parent->pcie_type != PCI_EXP_TYPE_DOWNSTREAM))
95 @@ -734,13 +727,18 @@ void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
96 * pci_disable_link_state - disable pci device's link state, so the link will
97 * never enter specific states
98 */
99 -static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
100 +static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem,
101 + bool force)
102 {
103 struct pci_dev *parent = pdev->bus->self;
104 struct pcie_link_state *link;
105
106 - if (aspm_disabled || !pci_is_pcie(pdev))
107 + if (aspm_disabled && !force)
108 + return;
109 +
110 + if (!pci_is_pcie(pdev))
111 return;
112 +
113 if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT ||
114 pdev->pcie_type == PCI_EXP_TYPE_DOWNSTREAM)
115 parent = pdev;
116 @@ -768,16 +766,31 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
117
118 void pci_disable_link_state_locked(struct pci_dev *pdev, int state)
119 {
120 - __pci_disable_link_state(pdev, state, false);
121 + __pci_disable_link_state(pdev, state, false, false);
122 }
123 EXPORT_SYMBOL(pci_disable_link_state_locked);
124
125 void pci_disable_link_state(struct pci_dev *pdev, int state)
126 {
127 - __pci_disable_link_state(pdev, state, true);
128 + __pci_disable_link_state(pdev, state, true, false);
129 }
130 EXPORT_SYMBOL(pci_disable_link_state);
131
132 +void pcie_clear_aspm(struct pci_bus *bus)
133 +{
134 + struct pci_dev *child;
135 +
136 + /*
137 + * Clear any ASPM setup that the firmware has carried out on this bus
138 + */
139 + list_for_each_entry(child, &bus->devices, bus_list) {
140 + __pci_disable_link_state(child, PCIE_LINK_STATE_L0S |
141 + PCIE_LINK_STATE_L1 |
142 + PCIE_LINK_STATE_CLKPM,
143 + false, true);
144 + }
145 +}
146 +
147 static int pcie_aspm_set_policy(const char *val, struct kernel_param *kp)
148 {
149 int i;
150 @@ -935,6 +948,7 @@ void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
151 static int __init pcie_aspm_disable(char *str)
152 {
153 if (!strcmp(str, "off")) {
154 + aspm_policy = POLICY_DEFAULT;
155 aspm_disabled = 1;
156 aspm_support_enabled = false;
157 printk(KERN_INFO "PCIe ASPM is disabled\n");
158 @@ -947,16 +961,18 @@ static int __init pcie_aspm_disable(char *str)
159
160 __setup("pcie_aspm=", pcie_aspm_disable);
161
162 -void pcie_clear_aspm(void)
163 -{
164 - if (!aspm_force)
165 - aspm_clear_state = 1;
166 -}
167 -
168 void pcie_no_aspm(void)
169 {
170 - if (!aspm_force)
171 + /*
172 + * Disabling ASPM is intended to prevent the kernel from modifying
173 + * existing hardware state, not to clear existing state. To that end:
174 + * (a) set policy to POLICY_DEFAULT in order to avoid changing state
175 + * (b) prevent userspace from changing policy
176 + */
177 + if (!aspm_force) {
178 + aspm_policy = POLICY_DEFAULT;
179 aspm_disabled = 1;
180 + }
181 }
182
183 /**
184 diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
185 index 7cea7b6..c832014 100644
186 --- a/include/linux/pci-aspm.h
187 +++ b/include/linux/pci-aspm.h
188 @@ -29,7 +29,7 @@ extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
189 extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
190 extern void pci_disable_link_state(struct pci_dev *pdev, int state);
191 extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
192 -extern void pcie_clear_aspm(void);
193 +extern void pcie_clear_aspm(struct pci_bus *bus);
194 extern void pcie_no_aspm(void);
195 #else
196 static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
197 @@ -47,7 +47,7 @@ static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
198 static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
199 {
200 }
201 -static inline void pcie_clear_aspm(void)
202 +static inline void pcie_clear_aspm(struct pci_bus *bus)
203 {
204 }
205 static inline void pcie_no_aspm(void)

  ViewVC Help
Powered by ViewVC 1.1.20