Skip to contentSkip to conversation

powerpc/powerpnv: Properly handle failure starting CPUs

PATCH New Benjamin Herrenschmidt 1 participant 1 message May 4, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powerpnv: Properly handle failure starting CPUs

If OPAL returns an error, propagate it upward rather than spinning seconds waiting for a CPU that will never show up

---
 arch/powerpc/platforms/powernv/smp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powernv/smp.c +3 -1
index 0bdc735..6a3ecca 100644
@@ -77,9 +77,11 @@ int pnv_smp_kick_cpu(int nr)
 	if (!paca[nr].cpu_start && firmware_has_feature(FW_FEATURE_OPALv2)) {
 		pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu);
 		rc = opal_start_cpu(pcpu, start_here);
-		if (rc != OPAL_SUCCESS)
+		if (rc != OPAL_SUCCESS) {
 			pr_warn("OPAL Error %ld starting CPU %d\n",
 				rc, nr);
+			return -ENODEV;
+		}
 	}
 	return smp_generic_kick_cpu(nr);
 }