Skip to content

Commit f1db6fd

Browse files
Bjorn Helgaasjbarnes993
authored andcommitted
x86/PCI: for debuggability, show host bridge windows even when ignoring _CRS
We have occasional problems with PCI resource allocation, and sometimes they could be avoided by paying attention to what ACPI tells us about the host bridges. This patch doesn't change the behavior, but it prints window information that should make debugging easier. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
1 parent 865df57 commit f1db6fd

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

‎arch/x86/pci/acpi.c‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
9292
start = addr.minimum + addr.translation_offset;
9393
end = start + addr.address_length - 1;
9494
if (info->res_num >= max_root_bus_resources) {
95-
printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx "
96-
"from %s for %s due to _CRS returning more than "
97-
"%d resource descriptors\n", (unsigned long) start,
98-
(unsigned long) end, root->name, info->name,
99-
max_root_bus_resources);
95+
if (pci_probe & PCI_USE__CRS)
96+
printk(KERN_WARNING "PCI: Failed to allocate "
97+
"0x%lx-0x%lx from %s for %s due to _CRS "
98+
"returning more than %d resource descriptors\n",
99+
(unsigned long) start, (unsigned long) end,
100+
root->name, info->name, max_root_bus_resources);
100101
return AE_OK;
101102
}
102103

@@ -107,6 +108,12 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
107108
res->end = end;
108109
res->child = NULL;
109110

111+
if (!(pci_probe & PCI_USE__CRS)) {
112+
dev_printk(KERN_DEBUG, &info->bridge->dev,
113+
"host bridge window %pR (ignored)\n", res);
114+
return AE_OK;
115+
}
116+
110117
if (insert_resource(root, res)) {
111118
dev_err(&info->bridge->dev,
112119
"can't allocate host bridge window %pR\n", res);
@@ -132,6 +139,11 @@ get_current_resources(struct acpi_device *device, int busnum,
132139
struct pci_root_info info;
133140
size_t size;
134141

142+
if (!(pci_probe & PCI_USE__CRS))
143+
dev_info(&device->dev,
144+
"ignoring host bridge windows from ACPI; "
145+
"boot with \"pci=use_crs\" to use them\n");
146+
135147
info.bridge = device;
136148
info.bus = bus;
137149
info.res_num = 0;
@@ -220,9 +232,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
220232
} else {
221233
bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
222234
if (bus) {
223-
if (pci_probe & PCI_USE__CRS)
224-
get_current_resources(device, busnum, domain,
225-
bus);
235+
get_current_resources(device, busnum, domain, bus);
226236
bus->subordinate = pci_scan_child_bus(bus);
227237
}
228238
}

0 commit comments

Comments
 (0)