Browse Source

x86/PCI: use _CRS bus number aperture for host bridges from ACPI

Add the host bridge bus number aperture from _CRS to the resource list.
Like the MMIO and I/O port apertures, this will be used when assigning
resources to hot-added devices or in the case of conflicts.

Note that we always use the _CRS bus number aperture, even if we're
ignoring _CRS otherwise.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Yinghai Lu 13 years ago
parent
commit
5c1d81d160
1 changed files with 5 additions and 4 deletions
  1. 5 4
      arch/x86/pci/acpi.c

+ 5 - 4
arch/x86/pci/acpi.c

@@ -12,7 +12,6 @@ struct pci_root_info {
 	char name[16];
 	char name[16];
 	unsigned int res_num;
 	unsigned int res_num;
 	struct resource *res;
 	struct resource *res;
-	int busnum;
 	struct pci_sysdata sd;
 	struct pci_sysdata sd;
 };
 };
 
 
@@ -347,7 +346,9 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
 {
 {
 	size_t size;
 	size_t size;
 
 
+	sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum);
 	info->bridge = device;
 	info->bridge = device;
+
 	info->res_num = 0;
 	info->res_num = 0;
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource,
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource,
 				info);
 				info);
@@ -360,8 +361,6 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
 	if (!info->res)
 	if (!info->res)
 		return;
 		return;
 
 
-	sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum);
-
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
 				info);
 				info);
 }
 }
@@ -426,6 +425,8 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
 	} else {
 	} else {
 		probe_pci_root_info(info, device, busnum, domain);
 		probe_pci_root_info(info, device, busnum, domain);
 
 
+		/* insert busn res at first */
+		pci_add_resource(&resources,  &root->secondary);
 		/*
 		/*
 		 * _CRS with no apertures is normal, so only fall back to
 		 * _CRS with no apertures is normal, so only fall back to
 		 * defaults or native bridge info if we're ignoring _CRS.
 		 * defaults or native bridge info if we're ignoring _CRS.
@@ -440,7 +441,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
 		bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
 		bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
 					  &resources);
 					  &resources);
 		if (bus) {
 		if (bus) {
-			bus->busn_res.end = pci_scan_child_bus(bus);
+			pci_scan_child_bus(bus);
 			pci_set_host_bridge_release(
 			pci_set_host_bridge_release(
 				to_pci_host_bridge(bus->bridge),
 				to_pci_host_bridge(bus->bridge),
 				release_pci_root_info, info);
 				release_pci_root_info, info);