diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-05-17 21:51:12 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-13 17:42:23 -0400 |
commit | 5c1d81d160cc46e36fdd06702885c98c2643b4c5 (patch) | |
tree | 2461530f8e19c7d4e5814028e5f6e033c8f2936b | |
parent | 857c3b668ae35c48d9d7a4248b6c0bdb65797d0e (diff) |
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>
-rw-r--r-- | arch/x86/pci/acpi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 350fe63c8a42..2bb885afe103 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -12,7 +12,6 @@ struct pci_root_info { | |||
12 | char name[16]; | 12 | char name[16]; |
13 | unsigned int res_num; | 13 | unsigned int res_num; |
14 | struct resource *res; | 14 | struct resource *res; |
15 | int busnum; | ||
16 | struct pci_sysdata sd; | 15 | struct pci_sysdata sd; |
17 | }; | 16 | }; |
18 | 17 | ||
@@ -347,7 +346,9 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, | |||
347 | { | 346 | { |
348 | size_t size; | 347 | size_t size; |
349 | 348 | ||
349 | sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum); | ||
350 | info->bridge = device; | 350 | info->bridge = device; |
351 | |||
351 | info->res_num = 0; | 352 | info->res_num = 0; |
352 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource, | 353 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource, |
353 | info); | 354 | info); |
@@ -360,8 +361,6 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, | |||
360 | if (!info->res) | 361 | if (!info->res) |
361 | return; | 362 | return; |
362 | 363 | ||
363 | sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum); | ||
364 | |||
365 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, | 364 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, |
366 | info); | 365 | info); |
367 | } | 366 | } |
@@ -426,6 +425,8 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) | |||
426 | } else { | 425 | } else { |
427 | probe_pci_root_info(info, device, busnum, domain); | 426 | probe_pci_root_info(info, device, busnum, domain); |
428 | 427 | ||
428 | /* insert busn res at first */ | ||
429 | pci_add_resource(&resources, &root->secondary); | ||
429 | /* | 430 | /* |
430 | * _CRS with no apertures is normal, so only fall back to | 431 | * _CRS with no apertures is normal, so only fall back to |
431 | * defaults or native bridge info if we're ignoring _CRS. | 432 | * 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) | |||
440 | bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd, | 441 | bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd, |
441 | &resources); | 442 | &resources); |
442 | if (bus) { | 443 | if (bus) { |
443 | bus->busn_res.end = pci_scan_child_bus(bus); | 444 | pci_scan_child_bus(bus); |
444 | pci_set_host_bridge_release( | 445 | pci_set_host_bridge_release( |
445 | to_pci_host_bridge(bus->bridge), | 446 | to_pci_host_bridge(bus->bridge), |
446 | release_pci_root_info, info); | 447 | release_pci_root_info, info); |