aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/acpi.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-06-24 23:00:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-30 16:44:24 -0400
commit626fdfec1588ac1341a37805809d03a719d977e0 (patch)
tree0f2bb4bcb5b36b3e856e2baadf89da8f9c3a541d /arch/x86/pci/acpi.c
parent2cdb3f1d834aab27a927be7555fbf4f9e43e9261 (diff)
x86/PCI: get root CRS before scanning children
This allows us to remove adjust_transparent_bridge_resources and give x86_pci_root_bus_res_quirks a chance when _CRS is not used or not there. Acked-by: Gary Hade <garyhade@us.ibm.com> Tested-by: Gary Hade <garyhade@us.ibm.com> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci/acpi.c')
-rw-r--r--arch/x86/pci/acpi.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 8bf152910eb0..1014eb4bfc37 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -118,23 +118,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
118} 118}
119 119
120static void 120static void
121adjust_transparent_bridge_resources(struct pci_bus *bus)
122{
123 struct pci_dev *dev;
124
125 list_for_each_entry(dev, &bus->devices, bus_list) {
126 int i;
127 u16 class = dev->class >> 8;
128
129 if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent) {
130 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
131 dev->subordinate->resource[i] =
132 dev->bus->resource[i - 3];
133 }
134 }
135}
136
137static void
138get_current_resources(struct acpi_device *device, int busnum, 121get_current_resources(struct acpi_device *device, int busnum,
139 int domain, struct pci_bus *bus) 122 int domain, struct pci_bus *bus)
140{ 123{
@@ -161,8 +144,6 @@ get_current_resources(struct acpi_device *device, int busnum,
161 info.res_num = 0; 144 info.res_num = 0;
162 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, 145 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
163 &info); 146 &info);
164 if (info.res_num)
165 adjust_transparent_bridge_resources(bus);
166 147
167 return; 148 return;
168 149
@@ -225,8 +206,15 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
225 */ 206 */
226 memcpy(bus->sysdata, sd, sizeof(*sd)); 207 memcpy(bus->sysdata, sd, sizeof(*sd));
227 kfree(sd); 208 kfree(sd);
228 } else 209 } else {
229 bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); 210 bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
211 if (bus) {
212 if (pci_probe & PCI_USE__CRS)
213 get_current_resources(device, busnum, domain,
214 bus);
215 bus->subordinate = pci_scan_child_bus(bus);
216 }
217 }
230 218
231 if (!bus) 219 if (!bus)
232 kfree(sd); 220 kfree(sd);
@@ -241,8 +229,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
241#endif 229#endif
242 } 230 }
243 231
244 if (bus && (pci_probe & PCI_USE__CRS))
245 get_current_resources(device, busnum, domain, bus);
246 return bus; 232 return bus;
247} 233}
248 234