powerpc: Don't setup CPUs with bad status
authorMichael Neuling <mikey@neuling.org>
Fri, 6 Jun 2014 04:28:51 +0000 (14:28 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 Jul 2014 12:33:49 +0000 (13:33 +0100)
commit 59a53afe70fd530040bdc69581f03d880157f15a upstream.

OPAL will mark a CPU that is guarded as "bad" in the status property of the CPU
node.

Unfortunatley Linux doesn't check this property and will put the bad CPU in the
present map.  This has caused hangs on booting when we try to unsplit the core.

This patch checks the CPU is avaliable via this status property before putting
it in the present map.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Tested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/powerpc/kernel/setup-common.c

index 77bb77d..82288e9 100644 (file)
@@ -449,7 +449,7 @@ void __init smp_setup_cpu_maps(void)
                for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {
                        DBG("    thread %d -> cpu %d (hard id %d)\n",
                            j, cpu, intserv[j]);
-                       set_cpu_present(cpu, true);
+                       set_cpu_present(cpu, of_device_is_available(dn));
                        set_hard_smp_processor_id(cpu, intserv[j]);
                        set_cpu_possible(cpu, true);
                        cpu++;