Skip to contentSkip to conversation

need check for devices with bad status status property in __of_scan_bus()

PATCH In review Sonny Rao 1 participant 2 messages May 11, 2010 – May 19, 2010 PowerPC

lore
Share & tools
lore

Sonny Rao

author
#0 lore raw

PATCH 1/1 need check for devices with bad status status property in __of_scan_bus()

Hi Ben, we ran into an issue where it looks like we're not properly ignoring a pci device with a non-good status property when we walk the device tree and create our device nodes.

However, the EEH init code does look for the property and
disables EEH on these devices. This leaves us in an
inconsistent where we are poking at a supposedly bad piece of hardware and RTAS will block our config cycles because EEH isn't enabled anyway.

This has only been compile tested.

arch/powerpc/kernel/pci_of_scan.c renamed from arch/powerpc/kernel.orig/pci_of_scan.c +2 -0
Index: common/arch/powerpc/kernel/pci_of_scan.c
===================================================================
@@ -310,6 +310,8 @@ static void __devinit __of_scan_bus(stru
 	/* Scan direct children */
 	for_each_child_of_node(node, child) {
 		pr_debug("  * %s\n", child->full_name);
+		if (!of_device_is_available(child))
+			continue;
 		reg = of_get_property(child, "reg", &reglen);
 		if (reg == NULL || reglen < 20)
 			continue;
Signature · 1 line
Sonny Rao, LTC OzLabs, BML team
author
#1 lore raw
Quoted 19 lines · Sonny Rao

Hi Ben, we ran into an issue where it looks like we're not properly ignoring a pci device with a non-good status property when we walk the device tree and create our device nodes.

However, the EEH init code does look for the property and
disables EEH on these devices. This leaves us in an
inconsistent where we are poking at a supposedly bad piece of hardware and RTAS will block our config cycles because EEH isn't enabled anyway.

This has only been compile tested.

Index: common/arch/powerpc/kernel/pci_of_scan.c
===================================================================

arch/powerpc/kernel/pci_of_scan.c static void __devinit __of_scan_bus(stru · line 317

Quoted 8 lines
arch/powerpc/kernel/pci_of_scan.c renamed from arch/powerpc/kernel.orig/pci_of_scan.c +2 -0
@@ -310,6 +310,8 @@ static void __devinit __of_scan_bus(stru
 	/* Scan direct children */
 	for_each_child_of_node(node, child) {
 		pr_debug("  * %s\n", child->full_name);
+		if (!of_device_is_available(child))
+			continue;
 		reg = of_get_property(child, "reg", &reglen);
 		if (reg == NULL || reglen < 20)
 			continue;

Ok, it's now been actually tested with firmware that marks some devices as failed and appears to work.

Signature · 1 line
Sonny Rao, LTC OzLabs, BML team