瀏覽代碼

ARM/PCI: Claim bus resources on PCI_PROBE_ONLY set-ups

We claim PCI BAR and bridge window resources in pci_bus_assign_resources(),
but when PCI_PROBE_ONLY is set, we treat those resources as immutable and
don't call pci_bus_assign_resources(), so the resources aren't put in the
resource tree.

When the resources aren't in the tree, they don't show up in /proc/iomem,
we can't detect conflicts, and we need special cases elsewhere for
PCI_PROBE_ONLY or resources without a parent pointer.

Claim all PCI BAR and window resources in the PCI_PROBE_ONLY case.

If a PCI_PROBE_ONLY platform assigns conflicting resources, Linux can't fix
the conflicts.  Previously we didn't notice the conflicts, but now we will,
which may expose new failures.

[bhelgaas: changelog, add resource comment, remove size/assign comments]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Russell King <linux@armlinux.org.uk>
Lorenzo Pieralisi 9 年之前
父節點
當前提交
b30742aa30
共有 1 個文件被更改,包括 9 次插入11 次删除
  1. 9 11
      arch/arm/kernel/bios32.c

+ 9 - 11
arch/arm/kernel/bios32.c

@@ -515,25 +515,23 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
 	list_for_each_entry(sys, &head, node) {
 	list_for_each_entry(sys, &head, node) {
 		struct pci_bus *bus = sys->bus;
 		struct pci_bus *bus = sys->bus;
 
 
-		if (!pci_has_flag(PCI_PROBE_ONLY)) {
+		/*
+		 * We insert PCI resources into the iomem_resource and
+		 * ioport_resource trees in either pci_bus_claim_resources()
+		 * or pci_bus_assign_resources().
+		 */
+		if (pci_has_flag(PCI_PROBE_ONLY)) {
+			pci_bus_claim_resources(bus);
+		} else {
 			struct pci_bus *child;
 			struct pci_bus *child;
 
 
-			/*
-			 * Size the bridge windows.
-			 */
 			pci_bus_size_bridges(bus);
 			pci_bus_size_bridges(bus);
-
-			/*
-			 * Assign resources.
-			 */
 			pci_bus_assign_resources(bus);
 			pci_bus_assign_resources(bus);
 
 
 			list_for_each_entry(child, &bus->children, node)
 			list_for_each_entry(child, &bus->children, node)
 				pcie_bus_configure_settings(child);
 				pcie_bus_configure_settings(child);
 		}
 		}
-		/*
-		 * Tell drivers about devices found.
-		 */
+
 		pci_bus_add_devices(bus);
 		pci_bus_add_devices(bus);
 	}
 	}
 }
 }