[PATCH 09/27] m32r, smpboot: Use generic SMP booting infrastructure

From: Srivatsa S. Bhat
Date: Fri Jun 01 2012 - 05:17:49 EST


Convert m32r to use the generic framework to boot secondary CPUs.

Notes:
Postpone enabling interrupts to after booting the secondary CPU fully.

Cc: Hirokazu Takata <takata@xxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: linux-m32r@xxxxxxxxxxxxxxxxx
Cc: linux-m32r-ja@xxxxxxxxxxxxxxxxx
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>
---

arch/m32r/kernel/smpboot.c | 46 ++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 6ddc51a..cf3fc0c 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -49,6 +49,7 @@
#include <linux/irq.h>
#include <linux/bootmem.h>
#include <linux/delay.h>
+#include <linux/smpboot.h>

#include <asm/io.h>
#include <asm/pgalloc.h>
@@ -114,7 +115,6 @@ static void do_boot_cpu(int);

int start_secondary(void *);
static void smp_callin(void);
-static void smp_online(void);

static void show_mp_info(int);
static void smp_store_cpu_info(int);
@@ -418,22 +418,38 @@ void __init smp_cpus_done(unsigned int max_cpus)
*==========================================================================*/
int __init start_secondary(void *unused)
{
+ smpboot_start_secondary(unused);
+ return 0;
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
+ unsigned int cpu;
+
cpu_init();
- preempt_disable();
smp_callin();
- while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask))
+
+ cpu = smp_processor_id();
+ while (!cpumask_test_cpu(cpu, &smp_commenced_mask))
cpu_relax();
+}

- smp_online();
+void __cpuinit __cpu_pre_online(void *unused)
+{
+ /* Get our bogomips. */
+ calibrate_delay();

+ /* Save our processor parameters */
+ smp_store_cpu_info(smp_processor_id());
+}
+
+void __cpuinit __cpu_post_online(void *unused)
+{
/*
* low-memory mappings have been cleared, flush them from
* the local TLBs too.
*/
local_flush_tlb_all();
-
- cpu_idle();
- return 0;
}

/*==========================================================================*
@@ -485,22 +501,6 @@ static void __init smp_callin(void)
cpumask_set_cpu(cpu_id, &cpu_callin_map);
}

-static void __init smp_online(void)
-{
- int cpu_id = smp_processor_id();
-
- notify_cpu_starting(cpu_id);
-
- local_irq_enable();
-
- /* Get our bogomips. */
- calibrate_delay();
-
- /* Save our processor parameters */
- smp_store_cpu_info(cpu_id);
-
- set_cpu_online(cpu_id, true);
-}

/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
/* Boot up CPUs common Routines */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/