Skip to contentSkip to conversation

fix the problem where pcix node is probed again as pci node.

PATCH In review Feng Kan 3 participants 6 messages Mar 30, 2010 PowerPC

lore
Share & tools
lore

Feng Kan

author
#0 lore raw

PATCH 1/1 fix the problem where pcix node is probed again as pci node.

From: Feng Kan <[email protected]>

The current matching scheme make the pci node match to pcix or pciex node. To avoid the match, change the method so only one type of initialization is called per node.

---
 arch/powerpc/sysdev/ppc4xx_pci.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +8 -6
index 8aa3302..1e67c74 100644
@@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
 
 	ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
 
+	for_each_compatible_node(np, NULL, "ibm,plb-pci") {
+		if (of_device_is_compatible(np, "ibm,plb-pcix"))
+			ppc4xx_probe_pcix_bridge(np);
 #ifdef CONFIG_PPC4xx_PCI_EXPRESS
-	for_each_compatible_node(np, NULL, "ibm,plb-pciex")
-		ppc4xx_probe_pciex_bridge(np);
+		else if (of_device_is_compatible(np, "ibm,plb-pciex"))
+			ppc4xx_probe_pciex_bridge(np);
 #endif
-	for_each_compatible_node(np, NULL, "ibm,plb-pcix")
-		ppc4xx_probe_pcix_bridge(np);
-	for_each_compatible_node(np, NULL, "ibm,plb-pci")
-		ppc4xx_probe_pci_bridge(np);
+		else
+			ppc4xx_probe_pci_bridge(np);
+	}
 
 	return 0;
 }
Signature · 1 line
1.5.5
#1 lore raw
Quoted 5 lines · Feng Kan

From: Feng Kan <[email protected]>

The current matching scheme make the pci node match to pcix or pciex node. To avoid the match, change the method so only one type of initialization is called per node.

No, your patch is not right. The problem was introduced by a patch from Grant that incorrectly made of_device_is_compatible do a substring match. Grant should have fixed that now. Grant ? Is your fix upstream yet ? If not, can you send that ASAP ?

Cheers,
Ben.

Quoted 33 lines
---
 arch/powerpc/sysdev/ppc4xx_pci.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +8 -6
index 8aa3302..1e67c74 100644
@@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
 
 	ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
 
+	for_each_compatible_node(np, NULL, "ibm,plb-pci") {
+		if (of_device_is_compatible(np, "ibm,plb-pcix"))
+			ppc4xx_probe_pcix_bridge(np);
 #ifdef CONFIG_PPC4xx_PCI_EXPRESS
-	for_each_compatible_node(np, NULL, "ibm,plb-pciex")
-		ppc4xx_probe_pciex_bridge(np);
+		else if (of_device_is_compatible(np, "ibm,plb-pciex"))
+			ppc4xx_probe_pciex_bridge(np);
 #endif
-	for_each_compatible_node(np, NULL, "ibm,plb-pcix")
-		ppc4xx_probe_pcix_bridge(np);
-	for_each_compatible_node(np, NULL, "ibm,plb-pci")
-		ppc4xx_probe_pci_bridge(np);
+		else
+			ppc4xx_probe_pci_bridge(np);
+	}
 
 	return 0;
 }
#2 lore raw
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 5 lines · Feng Kan

From: Feng Kan <[email protected]>

The current matching scheme make the pci node match to pcix or pciex node. To avoid the match, change the method so only one type of initialization is called per node.

No, your patch is not right. The problem was introduced by a patch from Grant that incorrectly made of_device_is_compatible do a substring match. Grant should have fixed that now. Grant ? Is your fix upstream yet ? If not, can you send that ASAP ?

Better if I CC him too :-)

Cheers,
Ben.

Quoted 43 lines

Cheers,
Ben.

Quoted 23 lines
---
 arch/powerpc/sysdev/ppc4xx_pci.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +5 -2
index 8aa3302..1e67c74 100644
@@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
 
 	ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
 
+	for_each_compatible_node(np, NULL, "ibm,plb-pci") {
+		if (of_device_is_compatible(np, "ibm,plb-pcix"))
+			ppc4xx_probe_pcix_bridge(np);
 #ifdef CONFIG_PPC4xx_PCI_EXPRESS
-	for_each_compatible_node(np, NULL, "ibm,plb-pciex")
-		ppc4xx_probe_pciex_bridge(np);
+		else if (of_device_is_compatible(np, "ibm,plb-pciex"))
+			ppc4xx_probe_pciex_bridge(np);
 #endif

arch/powerpc/sysdev/ppc4xx_pci.c static int __init ppc4xx_pci_find_bridges(void) · line 1857

Quoted 10 lines
arch/powerpc/sysdev/ppc4xx_pci.c +3 -4
-	for_each_compatible_node(np, NULL, "ibm,plb-pcix")
-		ppc4xx_probe_pcix_bridge(np);
-	for_each_compatible_node(np, NULL, "ibm,plb-pci")
-		ppc4xx_probe_pci_bridge(np);
+		else
+			ppc4xx_probe_pci_bridge(np);
+	}
 
 	return 0;
 }

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

author
#3 lore raw

Ok thanks. This short string match may be useful in some cases, but I agree it plays havoc with the current code.

Feng Kan

Quoted 65 lines · Benjamin Herrenschmidt
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 5 lines · Feng Kan

From: Feng Kan <[email protected]>

The current matching scheme make the pci node match to pcix or pciex node. To avoid the match, change the method so only one type of initialization is called per node.

No, your patch is not right. The problem was introduced by a patch from Grant that incorrectly made of_device_is_compatible do a substring match. Grant should have fixed that now. Grant ? Is your fix upstream yet ? If not, can you send that ASAP ?

Better if I CC him too :-)

Cheers,
Ben.

Quoted 45 lines

Cheers,
Ben.

Quoted 33 lines

---
arch/powerpc/sysdev/ppc4xx_pci.c | 14 ++++++++------

1 files changed, 8 insertions(+), 6 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +8 -6
index 8aa3302..1e67c74 100644
@@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges 
 (void)
 
   ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS |  
 PPC_PCI_COMPAT_DOMAIN_0;
 
+    for_each_compatible_node(np, NULL, "ibm,plb-pci") {
+        if (of_device_is_compatible(np, "ibm,plb-pcix"))
+            ppc4xx_probe_pcix_bridge(np);
 #ifdef CONFIG_PPC4xx_PCI_EXPRESS
-    for_each_compatible_node(np, NULL, "ibm,plb-pciex")
-        ppc4xx_probe_pciex_bridge(np);
+        else if (of_device_is_compatible(np, "ibm,plb-pciex"))
+            ppc4xx_probe_pciex_bridge(np);
 #endif
-    for_each_compatible_node(np, NULL, "ibm,plb-pcix")
-        ppc4xx_probe_pcix_bridge(np);
-    for_each_compatible_node(np, NULL, "ibm,plb-pci")
-        ppc4xx_probe_pci_bridge(np);
+        else
+            ppc4xx_probe_pci_bridge(np);
+    }
 
Quoted 2 lines
   return 0;
}

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#5 lore raw
In reply to Benjamin Herrenschmidt
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 5 lines · Feng Kan

From: Feng Kan <[email protected]>

The current matching scheme make the pci node match to pcix or pciex node. To avoid the match, change the method so only one type of initialization is called per node.

Quoted 6 lines
Quoted 4 lines

No, your patch is not right. The problem was introduced by a patch from Grant that incorrectly made of_device_is_compatible do a substring match. Grant should have fixed that now. Grant ? Is your fix upstream yet ? If not, can you send that ASAP ?

Better if I CC him too :-)

The fix is in upstream. Commit 1976152fd8e706135deed6cf333e347c08416056

g.

#4 lore raw
In reply to Feng Kan
Quoted 2 lines · Feng Kan

Ok thanks. This short string match may be useful in some cases, but I agree it plays havoc with the current code.

Yeah well, it's not actually -that- useful and is definitely broken :-)

If you want multiples matches, then it's the compatible property itself that should contain multiple entries since it's a list. The string match should be exact.

Cheers,
Ben.