Skip to contentSkip to conversation

powerpc: Remove bogus sanity check in pci -> OF node code

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Jan 11, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Remove bogus sanity check in pci -> OF node code

The new implementation of pci_device_to_OF_node() on ppc32 has a bogus sanity check in it that can cause oopses at boot when no device node is present, and might hit correct cases with older/weird apple device-trees where they have the type "vci" for the chaos bridge.

---

Zang, please confirm that this fixes your problem. If it does, paulus, this should go in 2.6.20

arch/powerpc/kernel/pci_32.c +0 -5
Index: linux-work/arch/powerpc/kernel/pci_32.c
===================================================================
@@ -775,11 +775,6 @@ static struct device_node *scan_OF_for_p
 	np = scan_OF_for_pci_dev(parent, bus->self->devfn);
 	of_node_put(parent);
 
-	/* sanity check */
-	if (strcmp(np->type, "pci") != 0)
-		printk(KERN_WARNING "pci: wrong type \"%s\" for bridge %s\n",
-		       np->type, np->full_name);
-
 	return np;
 }
 
#1 lore raw
Quoted 7 lines · Benjamin Herrenschmidt

The new implementation of pci_device_to_OF_node() on ppc32 has a bogus sanity check in it that can cause oopses at boot when no device node is
present, and might hit correct cases with older/weird apple device-trees
where they have the type "vci" for the chaos bridge.

Quoted 5 lines

---

Zang, please confirm that this fixes your problem. If it does, paulus, this should go in 2.6.20

It works for my problem. You remove them, so it is not necessary to test whether it is NULL.
This issue blocks my two boards: MPC8548CDS and MPC8641HPCN. it should go in 2.6.20.

Quoted 23 lines

Index: linux-work/arch/powerpc/kernel/pci_32.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci_32.c 2007-01-11
16:30:09.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci_32.c 2007-01-11
16:30:31.000000000 +1100

arch/powerpc/kernel/pci_32.c +0 -5
@@ -775,11 +775,6 @@ static struct device_node *scan_OF_for_p
        np = scan_OF_for_pci_dev(parent, bus->self->devfn);
        of_node_put(parent);
 
-       /* sanity check */
-       if (strcmp(np->type, "pci") != 0)
-               printk(KERN_WARNING "pci: wrong type \"%s\" for bridge
 %s\n",
-                      np->type, np->full_name);
-
        return np;
 }