Skip to contentSkip to conversation

ppc64: Rework PCI <-> OF node matching

PATCH New Benjamin Herrenschmidt 1 participant 1 message Oct 25, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64: Rework PCI <-> OF node matching

This patch reworks the code that deals with matching PCI devices with Open Firmware device nodes. This code made several incorrect assumptions and can be simplified significantly. The main functional difference now is that PHBs are no longer special cased, but that shouldn't cause any specific problem.
It also fixes a problem where u3_iommu.c wouldn't work for PCI devices that lacked a matching OF device node.

arch/ppc64/kernel/u3_iommu.c +6 -0
Index: linux-work/arch/ppc64/kernel/u3_iommu.c
===================================================================
@@ -267,6 +267,7 @@
 
 void iommu_setup_u3(void)
 {
+	struct pci_controller *phb, *tmp;
 	struct pci_dev *dev = NULL;
 	struct device_node *dn;
 
@@ -299,6 +300,11 @@
 		if (dn)
 			dn->iommu_table = &iommu_table_u3;
 	}
+	/* We also make sure we set all PHBs ... */
+	list_for_each_entry_safe(phb, tmp, &hose_list, list_node) {
+		dn = (struct device_node *)phb->arch_data;
+		dn->iommu_table = &iommu_table_u3;
+	}
 }
 
 void __init alloc_u3_dart_table(void)
arch/ppc64/kernel/pci_dn.c +34 -53

133 lines not on this page · raw message

Signature · 1 line
Benjamin Herrenschmidt <[email protected]>