diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/ia64/pci/pci.c | 12 | ||||
| -rw-r--r-- | arch/x86/pci/acpi.c | 33 | ||||
| -rw-r--r-- | arch/x86/pci/bus_numa.c | 3 | ||||
| -rw-r--r-- | arch/x86/pci/bus_numa.h | 3 |
4 files changed, 10 insertions, 41 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 89f957ca3eb2..64aff520b899 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
| @@ -320,9 +320,9 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
| 320 | static void __devinit | 320 | static void __devinit |
| 321 | pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) | 321 | pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) |
| 322 | { | 322 | { |
| 323 | int i, j; | 323 | int i; |
| 324 | 324 | ||
| 325 | j = 0; | 325 | pci_bus_remove_resources(bus); |
| 326 | for (i = 0; i < ctrl->windows; i++) { | 326 | for (i = 0; i < ctrl->windows; i++) { |
| 327 | struct resource *res = &ctrl->window[i].resource; | 327 | struct resource *res = &ctrl->window[i].resource; |
| 328 | /* HP's firmware has a hack to work around a Windows bug. | 328 | /* HP's firmware has a hack to work around a Windows bug. |
| @@ -330,13 +330,7 @@ pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) | |||
| 330 | if ((res->flags & IORESOURCE_MEM) && | 330 | if ((res->flags & IORESOURCE_MEM) && |
| 331 | (res->end - res->start < 16)) | 331 | (res->end - res->start < 16)) |
| 332 | continue; | 332 | continue; |
| 333 | if (j >= PCI_BUS_NUM_RESOURCES) { | 333 | pci_bus_add_resource(bus, res, 0); |
| 334 | dev_warn(&bus->dev, | ||
| 335 | "ignoring host bridge window %pR (no space)\n", | ||
| 336 | res); | ||
| 337 | continue; | ||
| 338 | } | ||
| 339 | bus->resource[j++] = res; | ||
| 340 | } | 334 | } |
| 341 | } | 335 | } |
| 342 | 336 | ||
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 959e548a7039..a2f8cdb8c1d5 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
| @@ -45,20 +45,6 @@ count_resource(struct acpi_resource *acpi_res, void *data) | |||
| 45 | return AE_OK; | 45 | return AE_OK; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | static int | ||
| 49 | bus_has_transparent_bridge(struct pci_bus *bus) | ||
| 50 | { | ||
| 51 | struct pci_dev *dev; | ||
| 52 | |||
| 53 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
| 54 | u16 class = dev->class >> 8; | ||
| 55 | |||
| 56 | if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent) | ||
| 57 | return true; | ||
| 58 | } | ||
| 59 | return false; | ||
| 60 | } | ||
| 61 | |||
| 62 | static void | 48 | static void |
| 63 | align_resource(struct acpi_device *bridge, struct resource *res) | 49 | align_resource(struct acpi_device *bridge, struct resource *res) |
| 64 | { | 50 | { |
| @@ -92,12 +78,8 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 92 | acpi_status status; | 78 | acpi_status status; |
| 93 | unsigned long flags; | 79 | unsigned long flags; |
| 94 | struct resource *root; | 80 | struct resource *root; |
| 95 | int max_root_bus_resources = PCI_BUS_NUM_RESOURCES; | ||
| 96 | u64 start, end; | 81 | u64 start, end; |
| 97 | 82 | ||
| 98 | if (bus_has_transparent_bridge(info->bus)) | ||
| 99 | max_root_bus_resources -= 3; | ||
| 100 | |||
| 101 | status = resource_to_addr(acpi_res, &addr); | 83 | status = resource_to_addr(acpi_res, &addr); |
| 102 | if (!ACPI_SUCCESS(status)) | 84 | if (!ACPI_SUCCESS(status)) |
| 103 | return AE_OK; | 85 | return AE_OK; |
| @@ -115,15 +97,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 115 | 97 | ||
| 116 | start = addr.minimum + addr.translation_offset; | 98 | start = addr.minimum + addr.translation_offset; |
| 117 | end = start + addr.address_length - 1; | 99 | end = start + addr.address_length - 1; |
| 118 | if (info->res_num >= max_root_bus_resources) { | ||
| 119 | if (pci_probe & PCI_USE__CRS) | ||
| 120 | printk(KERN_WARNING "PCI: Failed to allocate " | ||
| 121 | "0x%lx-0x%lx from %s for %s due to _CRS " | ||
| 122 | "returning more than %d resource descriptors\n", | ||
| 123 | (unsigned long) start, (unsigned long) end, | ||
| 124 | root->name, info->name, max_root_bus_resources); | ||
| 125 | return AE_OK; | ||
| 126 | } | ||
| 127 | 100 | ||
| 128 | res = &info->res[info->res_num]; | 101 | res = &info->res[info->res_num]; |
| 129 | res->name = info->name; | 102 | res->name = info->name; |
| @@ -143,7 +116,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 143 | dev_err(&info->bridge->dev, | 116 | dev_err(&info->bridge->dev, |
| 144 | "can't allocate host bridge window %pR\n", res); | 117 | "can't allocate host bridge window %pR\n", res); |
| 145 | } else { | 118 | } else { |
| 146 | info->bus->resource[info->res_num] = res; | 119 | pci_bus_add_resource(info->bus, res, 0); |
| 147 | info->res_num++; | 120 | info->res_num++; |
| 148 | if (addr.translation_offset) | 121 | if (addr.translation_offset) |
| 149 | dev_info(&info->bridge->dev, "host bridge window %pR " | 122 | dev_info(&info->bridge->dev, "host bridge window %pR " |
| @@ -164,7 +137,9 @@ get_current_resources(struct acpi_device *device, int busnum, | |||
| 164 | struct pci_root_info info; | 137 | struct pci_root_info info; |
| 165 | size_t size; | 138 | size_t size; |
| 166 | 139 | ||
| 167 | if (!(pci_probe & PCI_USE__CRS)) | 140 | if (pci_probe & PCI_USE__CRS) |
| 141 | pci_bus_remove_resources(bus); | ||
| 142 | else | ||
| 168 | dev_info(&device->dev, | 143 | dev_info(&device->dev, |
| 169 | "ignoring host bridge windows from ACPI; " | 144 | "ignoring host bridge windows from ACPI; " |
| 170 | "boot with \"pci=use_crs\" to use them\n"); | 145 | "boot with \"pci=use_crs\" to use them\n"); |
diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index f939d603adfa..12d54ff3654d 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c | |||
| @@ -36,13 +36,14 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b) | |||
| 36 | printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n", | 36 | printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n", |
| 37 | b->number); | 37 | b->number); |
| 38 | 38 | ||
| 39 | pci_bus_remove_resources(b); | ||
| 39 | info = &pci_root_info[i]; | 40 | info = &pci_root_info[i]; |
| 40 | for (j = 0; j < info->res_num; j++) { | 41 | for (j = 0; j < info->res_num; j++) { |
| 41 | struct resource *res; | 42 | struct resource *res; |
| 42 | struct resource *root; | 43 | struct resource *root; |
| 43 | 44 | ||
| 44 | res = &info->res[j]; | 45 | res = &info->res[j]; |
| 45 | b->resource[j] = res; | 46 | pci_bus_add_resource(b, res, 0); |
| 46 | if (res->flags & IORESOURCE_IO) | 47 | if (res->flags & IORESOURCE_IO) |
| 47 | root = &ioport_resource; | 48 | root = &ioport_resource; |
| 48 | else | 49 | else |
diff --git a/arch/x86/pci/bus_numa.h b/arch/x86/pci/bus_numa.h index adbc23fe82ac..731b64ee8d84 100644 --- a/arch/x86/pci/bus_numa.h +++ b/arch/x86/pci/bus_numa.h | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * sub bus (transparent) will use entres from 3 to store extra from | 4 | * sub bus (transparent) will use entres from 3 to store extra from |
| 5 | * root, so need to make sure we have enough slot there, Should we | 5 | * root, so need to make sure we have enough slot there. |
| 6 | * increase PCI_BUS_NUM_RESOURCES? | ||
| 7 | */ | 6 | */ |
| 8 | #define RES_NUM 16 | 7 | #define RES_NUM 16 |
| 9 | struct pci_root_info { | 8 | struct pci_root_info { |
