[PATCH] powerpc: Allow non zero boot cpuids
[linux-2.6-block.git] / arch / powerpc / kernel / setup-common.c
index be12041c0fc5404ab8b811050f45de883c225631..b17630ad4ac73f361658c50d08367ff3d518e1f4 100644 (file)
@@ -162,9 +162,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 #if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
                unsigned long bogosum = 0;
                int i;
-               for (i = 0; i < NR_CPUS; ++i)
-                       if (cpu_online(i))
-                               bogosum += loops_per_jiffy;
+               for_each_online_cpu(i)
+                       bogosum += loops_per_jiffy;
                seq_printf(m, "total bogomips\t: %lu.%02lu\n",
                           bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
 #endif /* CONFIG_SMP && CONFIG_PPC32 */
@@ -353,12 +352,13 @@ void __init check_for_initrd(void)
  * must be called before using this.
  *
  * While we're here, we may as well set the "physical" cpu ids in the paca.
+ *
+ * NOTE: This must match the parsing done in early_init_dt_scan_cpus.
  */
 void __init smp_setup_cpu_maps(void)
 {
        struct device_node *dn = NULL;
        int cpu = 0;
-       int swap_cpuid = 0;
 
        while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
                int *intserv;
@@ -377,24 +377,11 @@ void __init smp_setup_cpu_maps(void)
                for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
                        cpu_set(cpu, cpu_present_map);
                        set_hard_smp_processor_id(cpu, intserv[j]);
-
-                       if (intserv[j] == boot_cpuid_phys)
-                               swap_cpuid = cpu;
                        cpu_set(cpu, cpu_possible_map);
                        cpu++;
                }
        }
 
-       /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that
-        * boot cpu is logical 0.
-        */
-       if (boot_cpuid_phys != get_hard_smp_processor_id(0)) {
-               u32 tmp;
-               tmp = get_hard_smp_processor_id(0);
-               set_hard_smp_processor_id(0, boot_cpuid_phys);
-               set_hard_smp_processor_id(swap_cpuid, tmp);
-       }
-
 #ifdef CONFIG_PPC64
        /*
         * On pSeries LPAR, we need to know how many cpus