[POWERPC] Fix per-cpu allocation on oldworld SMP powermacs
authorPaul Mackerras <paulus@samba.org>
Thu, 7 Jun 2007 12:42:19 +0000 (22:42 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 14 Jun 2007 01:56:17 +0000 (11:56 +1000)
The per-cpu area(a) for the secondary CPU(s) isn't getting allocated
on old SMP powermacs that don't have the secondary CPU(s) listed in
the device tree, as per-cpu areas are now only allocated for CPUs in
the cpu_possible_map, and we aren't setting the bits for the secondary
CPU(s) until smp_prepare_cpus(), which is after per-cpu allocation.
Therefore this sets the bits for CPUs 1..3 in cpu_possible_map in
pmac_setup_arch, so they get per-cpu data allocated.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/powermac/smp.c

index 07b1c4ec428d590daa4882638118dbee161a343c..956571526a57bcc4169dafc3d7c74ff4b0a7dbaa 100644 (file)
@@ -363,8 +363,19 @@ static void __init pmac_setup_arch(void)
                smp_ops = &core99_smp_ops;
        }
 #ifdef CONFIG_PPC32
-       else
+       else {
+               /*
+                * We have to set bits in cpu_possible_map here since the
+                * secondary CPU(s) aren't in the device tree, and
+                * setup_per_cpu_areas only allocates per-cpu data for
+                * CPUs in the cpu_possible_map.
+                */
+               int cpu;
+
+               for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
+                       cpu_set(cpu, cpu_possible_map);
                smp_ops = &psurge_smp_ops;
+       }
 #endif
 #endif /* CONFIG_SMP */
 
index 686ed82bde79a6608abcf5915848a47a6ff8ffc8..cb2d894541c642609d3e9f408fd91484daa99fa4 100644 (file)
@@ -317,7 +317,6 @@ static int __init smp_psurge_probe(void)
                ncpus = NR_CPUS;
        for (i = 1; i < ncpus ; ++i) {
                cpu_set(i, cpu_present_map);
-               cpu_set(i, cpu_possible_map);
                set_hard_smp_processor_id(i, i);
        }