[PATCH] PCI dev node without an OF node

Jimi Xenidis jimix at watson.ibm.com
Wed Oct 5 05:35:00 EST 2005


Handing the pSeries_iommu*LP logic the device tree from a Maple-D results
in PCI dev  nodes that do not have a corresponding OF node.

I cannot be certain if this is a bug with the devtree in PIBS, or if
this case is normally possible, I believe it is the latter.

The check for dn==NULL used to happen in iommu_dev_setup_pSeries() but
that is no longer called as of:
   http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;h=d17f0108a03200c0437146f199acaab21ca6f678;hp=f0fd7fbd6531cd01fb8984d2c81e82a25825b484;hb=1635317facea3094ddf34082cd86797efb1d9f7e;f=arch/ppc64/kernel/pSeries_iommu.c

so the following patch catches it.

Signed-off-by: Jimi Xenidis <jimix at watson.ibm.com>


diff -r fbe71a6b8d00 arch/ppc64/kernel/pSeries_iommu.c
--- a/arch/ppc64/kernel/pSeries_iommu.c	Tue Oct  4 19:14:08 2005
+++ b/arch/ppc64/kernel/pSeries_iommu.c	Tue Oct  4 15:15:32 2005
@@ -513,6 +513,11 @@
 	 * already allocated.
 	 */
 	dn = pci_device_to_OF_node(dev);
+	if (dn == NULL) {
+		DBG("%s, dev %p (%s) has no iommu table\n",
+		    dev, pci_name(dev));
+		return;
+	}
 
 	for (pdn = dn; pdn && pdn->data && !PCI_DN(pdn)->iommu_table;
 	     pdn = pdn->parent) {

-- 
 "I got an idea, an idea so smart my head would explode if I even
  began to know what I was talking about." -- Peter Griffin (Family Guy)




More information about the Linuxppc64-dev mailing list