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

STALE7186d

2 messages, 2 authors, 2007-01-11 · open the first message on its own page

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

From: Benjamin Herrenschmidt <hidden>
Date: 2007-01-11 05:40:42

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.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

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


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
@@ -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;
 }
 

Re: [PATCH] powerpc: Remove bogus sanity check in pci -> OF node code

From: Zang Roy-r61911 <hidden>
Date: 2007-01-11 05:51:49

On Thu, 2007-01-11 at 13:38, Benjamin Herrenschmidt wrote:
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.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

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 hunk

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
@@ -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;
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help