|
@@ -45,20 +45,6 @@ count_resource(struct acpi_resource *acpi_res, void *data)
|
|
return AE_OK;
|
|
return AE_OK;
|
|
}
|
|
}
|
|
|
|
|
|
-static int
|
|
|
|
-bus_has_transparent_bridge(struct pci_bus *bus)
|
|
|
|
-{
|
|
|
|
- struct pci_dev *dev;
|
|
|
|
-
|
|
|
|
- list_for_each_entry(dev, &bus->devices, bus_list) {
|
|
|
|
- u16 class = dev->class >> 8;
|
|
|
|
-
|
|
|
|
- if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent)
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void
|
|
static void
|
|
align_resource(struct acpi_device *bridge, struct resource *res)
|
|
align_resource(struct acpi_device *bridge, struct resource *res)
|
|
{
|
|
{
|
|
@@ -92,12 +78,8 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
|
|
acpi_status status;
|
|
acpi_status status;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
struct resource *root;
|
|
struct resource *root;
|
|
- int max_root_bus_resources = PCI_BUS_NUM_RESOURCES;
|
|
|
|
u64 start, end;
|
|
u64 start, end;
|
|
|
|
|
|
- if (bus_has_transparent_bridge(info->bus))
|
|
|
|
- max_root_bus_resources -= 3;
|
|
|
|
-
|
|
|
|
status = resource_to_addr(acpi_res, &addr);
|
|
status = resource_to_addr(acpi_res, &addr);
|
|
if (!ACPI_SUCCESS(status))
|
|
if (!ACPI_SUCCESS(status))
|
|
return AE_OK;
|
|
return AE_OK;
|
|
@@ -115,15 +97,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
|
|
|
|
|
|
start = addr.minimum + addr.translation_offset;
|
|
start = addr.minimum + addr.translation_offset;
|
|
end = start + addr.address_length - 1;
|
|
end = start + addr.address_length - 1;
|
|
- if (info->res_num >= max_root_bus_resources) {
|
|
|
|
- if (pci_probe & PCI_USE__CRS)
|
|
|
|
- printk(KERN_WARNING "PCI: Failed to allocate "
|
|
|
|
- "0x%lx-0x%lx from %s for %s due to _CRS "
|
|
|
|
- "returning more than %d resource descriptors\n",
|
|
|
|
- (unsigned long) start, (unsigned long) end,
|
|
|
|
- root->name, info->name, max_root_bus_resources);
|
|
|
|
- return AE_OK;
|
|
|
|
- }
|
|
|
|
|
|
|
|
res = &info->res[info->res_num];
|
|
res = &info->res[info->res_num];
|
|
res->name = info->name;
|
|
res->name = info->name;
|
|
@@ -143,7 +116,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
|
|
dev_err(&info->bridge->dev,
|
|
dev_err(&info->bridge->dev,
|
|
"can't allocate host bridge window %pR\n", res);
|
|
"can't allocate host bridge window %pR\n", res);
|
|
} else {
|
|
} else {
|
|
- info->bus->resource[info->res_num] = res;
|
|
|
|
|
|
+ pci_bus_add_resource(info->bus, res, 0);
|
|
info->res_num++;
|
|
info->res_num++;
|
|
if (addr.translation_offset)
|
|
if (addr.translation_offset)
|
|
dev_info(&info->bridge->dev, "host bridge window %pR "
|
|
dev_info(&info->bridge->dev, "host bridge window %pR "
|
|
@@ -164,7 +137,9 @@ get_current_resources(struct acpi_device *device, int busnum,
|
|
struct pci_root_info info;
|
|
struct pci_root_info info;
|
|
size_t size;
|
|
size_t size;
|
|
|
|
|
|
- if (!(pci_probe & PCI_USE__CRS))
|
|
|
|
|
|
+ if (pci_probe & PCI_USE__CRS)
|
|
|
|
+ pci_bus_remove_resources(bus);
|
|
|
|
+ else
|
|
dev_info(&device->dev,
|
|
dev_info(&device->dev,
|
|
"ignoring host bridge windows from ACPI; "
|
|
"ignoring host bridge windows from ACPI; "
|
|
"boot with \"pci=use_crs\" to use them\n");
|
|
"boot with \"pci=use_crs\" to use them\n");
|