Browse Source

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>
Bjorn Helgaas 15 years ago
parent
commit
f1db6fde09
1 changed files with 18 additions and 8 deletions
  1. 18 8
      arch/x86/pci/acpi.c

+ 18 - 8
arch/x86/pci/acpi.c

@@ -92,11 +92,12 @@ 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 (info->res_num >= max_root_bus_resources) {
-		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);
+		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;
 		return AE_OK;
 	}
 	}
 
 
@@ -107,6 +108,12 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
 	res->end = end;
 	res->end = end;
 	res->child = NULL;
 	res->child = NULL;
 
 
+	if (!(pci_probe & PCI_USE__CRS)) {
+		dev_printk(KERN_DEBUG, &info->bridge->dev,
+			   "host bridge window %pR (ignored)\n", res);
+		return AE_OK;
+	}
+
 	if (insert_resource(root, res)) {
 	if (insert_resource(root, res)) {
 		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);
@@ -132,6 +139,11 @@ 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))
+		dev_info(&device->dev,
+			 "ignoring host bridge windows from ACPI; "
+			 "boot with \"pci=use_crs\" to use them\n");
+
 	info.bridge = device;
 	info.bridge = device;
 	info.bus = bus;
 	info.bus = bus;
 	info.res_num = 0;
 	info.res_num = 0;
@@ -220,9 +232,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
 	} else {
 	} else {
 		bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
 		bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
 		if (bus) {
 		if (bus) {
-			if (pci_probe & PCI_USE__CRS)
-				get_current_resources(device, busnum, domain,
-							bus);
+			get_current_resources(device, busnum, domain, bus);
 			bus->subordinate = pci_scan_child_bus(bus);
 			bus->subordinate = pci_scan_child_bus(bus);
 		}
 		}
 	}
 	}