Skip to contentSkip to conversation

PCI Hotplug: remove incorrect rpaphp firmware dependency

PATCH David Woodhouse 3 participants 6 messages Feb 7, 2005 – Feb 8, 2005 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 11 lines · Linux Kernel Mailing List

[PATCH] PCI Hotplug: remove incorrect rpaphp firmware dependency

The RPA PCI Hotplug module incorrectly uses a certain firmware property when determining the hotplug capabilities of a slot. Recent firmware changes have demonstrated that this property should not be referenced or depended upon by the OS. This patch removes the dependency, and implements a correct set of logic for determining hotplug capabilities.

Review

Quoted 7 lines
(quoted diff) +7 -0
+       rc = get_children_props(dn, indexes, names, &drc_types, power_domains);
+       if (rc) {
+               if (is_php_type((char *) &drc_types[1])) {
+                       *types = drc_types;
+                       return 1;
+               }
+       }

Er, use the result of the get_children_props() call only if it _failed_? I suspect that wasn't your intention. This makes my G5 boot again:

drivers/pci/hotplug/rpaphp_core.c renamed from drivers/pci/hotplug/rpaphp_core.c.orig +1 -1
@@ -307,7 +307,7 @@ static int is_php_dn(struct device_node 
 	int rc;
 
 	rc = get_children_props(dn, indexes, names, &drc_types, power_domains);
-	if (rc) {
+	if (!rc) {
 		if (is_php_type((char *) &drc_types[1])) {
 			*types = drc_types;
 			return 1;
Signature · 1 line
dwmw2
#2 lore raw
Quoted 2 lines

Er, use the result of the get_children_props() call only if it _failed_? I suspect that wasn't your intention. This makes my G5 boot again:

Doh, good catch! This was an oversight while patching multiple trees for this bug. Previous versions of that function use 1 for success. Sigh. BTW, you're running an RPA module on your G5?

Thanks-
John

#3 lore raw

Could we please get David's fix in for 2.6.11, since it's apparently affecting boot in some situations?

Thanks-
John

Quoted 9 lines · John Rose
Quoted 2 lines

Er, use the result of the get_children_props() call only if it _failed_? I suspect that wasn't your intention. This makes my G5 boot again:

Doh, good catch! This was an oversight while patching multiple trees for this bug. Previous versions of that function use 1 for success. Sigh. BTW, you're running an RPA module on your G5?

Thanks-
John

#4 lore raw
Quoted 3 lines · John Rose

Could we please get David's fix in for 2.6.11, since it's apparently
affecting boot in some situations?

Yup, I can take care of that.

#5 lore raw
In reply to John Rose
Quoted 1 line · John Rose

BTW, you're running an RPA module on your G5?

Fedora uses the same ppc64 kernel for both pSeries and G5.

Signature · 1 line
dwmw2
#6 lore raw
In reply to David Woodhouse
Quoted 2 lines

Er, use the result of the get_children_props() call only if it _failed_? I suspect that wasn't your intention. This makes my G5 boot again:

Here's an alternate fix for the ppc64 crash during boot. This corrects the offending function to use more conventional error codes. I'll follow up with return code cleanups for the entire module, and for RTAS code, since these are probably too big for 2.6.11.

Please apply, if appropriate.

Thanks-
John

drivers/pci/hotplug/rpaphp_core.c renamed from drivers/pci/hotplug/rpaphp_core.c~01_rpaphp_is_php_fix +4 -4
diff -puN drivers/pci/hotplug/rpaphp_core.c~01_rpaphp_is_php_fix drivers/pci/hotplug/rpaphp_core.c
@@ -224,7 +224,7 @@ static int get_children_props(struct dev
 
 	if (!indexes || !names || !types || !domains) {
 		/* Slot does not have dynamically-removable children */
-		return 1;
+		return -EINVAL;
 	}
 	if (drc_indexes)
 		*drc_indexes = indexes;
@@ -260,7 +260,7 @@ int rpaphp_get_drc_props(struct device_n
 	}
 
 	rc = get_children_props(dn->parent, &indexes, &names, &types, &domains);
-	if (rc) {
+	if (rc < 0) {
 		return 1;
 	}
 
@@ -307,7 +307,7 @@ static int is_php_dn(struct device_node 
 	int rc;
 
 	rc = get_children_props(dn, indexes, names, &drc_types, power_domains);
-	if (rc) {
+	if (rc >= 0) {
 		if (is_php_type((char *) &drc_types[1])) {
 			*types = drc_types;
 			return 1;
@@ -331,7 +331,7 @@ static int is_dr_dn(struct device_node *
 
 	rc = get_children_props(dn->parent, indexes, names, types,
 				power_domains);
-	return (rc == 0);
+	return (rc >= 0);
 }
 
 static inline int is_vdevice_root(struct device_node *dn)

_