[PATCH 12/27] tile, smpboot: Use generic SMP booting infrastructure

From: Srivatsa S. Bhat
Date: Fri Jun 01 2012 - 05:56:31 EST


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

Notes:
1. Don't enable interrupts in start_secondary().
2. Remove the unnecessary calls to local_irq_enable() in __cpu_up().
3. cpu_idle() was being called after doing a preempt_enable() instead
of a preempt_disable()! Fix it.

Cc: Chris Metcalf <cmetcalf@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Yong Zhang <yong.zhang0@xxxxxxxxx>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>
---

arch/tile/kernel/smpboot.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c
index 24a9c06..8558824 100644
--- a/arch/tile/kernel/smpboot.c
+++ b/arch/tile/kernel/smpboot.c
@@ -145,8 +145,6 @@ static void __cpuinit start_secondary(void)
/* Set our thread pointer appropriately. */
set_my_cpu_offset(__per_cpu_offset[cpuid]);

- preempt_disable();
-
/*
* In large machines even this will slow us down, since we
* will be contending for for the printk spinlock.
@@ -165,7 +163,6 @@ static void __cpuinit start_secondary(void)

/* Allow hypervisor messages to be received */
init_messaging();
- local_irq_enable();

/* Indicate that we're ready to come up. */
/* Must not do this before we're ready to receive messages */
@@ -183,6 +180,11 @@ static void __cpuinit start_secondary(void)
*/
void __cpuinit online_secondary(void)
{
+ smpboot_start_secondary(NULL);
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
/*
* low-memory mappings have been cleared, flush them from
* the local TLBs too.
@@ -193,21 +195,15 @@ void __cpuinit online_secondary(void)

/* This must be done before setting cpu_online_mask */
wmb();
+}

- notify_cpu_starting(smp_processor_id());
-
- set_cpu_online(smp_processor_id(), 1);
- __get_cpu_var(cpu_state) = CPU_ONLINE;
-
+void __cpuinit __cpu_post_online(void *unused)
+{
/* Set up tile-specific state for this cpu. */
setup_cpu(0);

/* Set up tile-timer clock-event device on this cpu */
setup_tile_timer();
-
- preempt_enable();
-
- cpu_idle();
}

int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
@@ -217,13 +213,11 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
for (; !cpumask_test_cpu(cpu, &cpu_started); timeout++) {
if (timeout >= 50000) {
pr_info("skipping unresponsive cpu%d\n", cpu);
- local_irq_enable();
return -EIO;
}
udelay(100);
}

- local_irq_enable();
per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;

/* Unleash the CPU! */

--
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/