ppc64: Rework PCI <-> OF node matching
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.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
arch/ppc64/kernel/u3_iommu.c +6 -0
@@ -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]>