ARM: SMP: move CPU number sanity checks to smp_init_cpus()
[deliverable/linux.git] / arch / arm / mach-ux500 / platsmp.c
index 9e4c678de78593a248c9010a4eb8e0edcb4cb4dc..a51962b7579baa1a8f589c95524f89e7f62d8f8e 100644 (file)
@@ -78,7 +78,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
        __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
        outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1);
 
-       smp_cross_call(cpumask_of(cpu));
+       smp_cross_call(cpumask_of(cpu), 1);
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
@@ -128,16 +128,6 @@ void __init smp_init_cpus(void)
 {
        unsigned int i, ncores = get_core_count();
 
-       for (i = 0; i < ncores; i++)
-               set_cpu_possible(i, true);
-}
-
-void __init smp_prepare_cpus(unsigned int max_cpus)
-{
-       unsigned int ncores = get_core_count();
-       unsigned int cpu = smp_processor_id();
-       int i;
-
        /* sanity check */
        if (ncores == 0) {
                printk(KERN_ERR
@@ -145,14 +135,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                ncores = 1;
        }
 
-       if (ncores > num_possible_cpus())       {
+       if (ncores > NR_CPUS) {
                printk(KERN_WARNING
                       "U8500: no. of cores (%d) greater than configured "
                       "maximum of %d - clipping\n",
-                      ncores, num_possible_cpus());
-               ncores = num_possible_cpus();
+                      ncores, NR_CPUS);
+               ncores = NR_CPUS;
        }
 
+       for (i = 0; i < ncores; i++)
+               set_cpu_possible(i, true);
+}
+
+void __init smp_prepare_cpus(unsigned int max_cpus)
+{
+       unsigned int ncores = num_possible_cpus();
+       unsigned int cpu = smp_processor_id();
+       int i;
+
        smp_store_cpu_info(cpu);
 
        /*
This page took 0.025077 seconds and 5 git commands to generate.