[PATCH 19/27] blackfin,smpboot: Use generic SMP booting infrastructure

From: Srivatsa S. Bhat
Date: Fri Jun 01 2012 - 05:52:59 EST


From: Nikunj A. Dadhania <nikunj@xxxxxxxxxxxxxxxxxx>

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

Notes:
The call to set_cpu_online() is removed from platform_secondary_init(), since
it will now be done by generic SMP booting code.

Signed-off-by: Nikunj A. Dadhania <nikunj@xxxxxxxxxxxxxxxxxx>
Cc: Mike Frysinger <vapier@xxxxxxxxxx>
Cc: Bob Liu <lliubbo@xxxxxxxxx>
Cc: Steven Miao <realmz6@xxxxxxxxx>
Cc: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>
---

arch/blackfin/mach-bf561/smp.c | 1 -
arch/blackfin/mach-common/smp.c | 16 +++++++++-------
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
index ab1c617..e7e2e50 100644
--- a/arch/blackfin/mach-bf561/smp.c
+++ b/arch/blackfin/mach-bf561/smp.c
@@ -69,7 +69,6 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
SSYNC();

/* We are done with local CPU inits, unblock the boot CPU. */
- set_cpu_online(cpu, true);
spin_lock(&boot_lock);
spin_unlock(&boot_lock);
}
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 00bbe67..9ee6f2f 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -25,6 +25,7 @@
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/atomic.h>
+#include <linux/smpboot.h>
#include <asm/cacheflush.h>
#include <asm/irq_handler.h>
#include <asm/mmu_context.h>
@@ -373,6 +374,11 @@ static void __cpuinit setup_secondary(unsigned int cpu)

void __cpuinit secondary_start_kernel(void)
{
+ smpboot_start_secondary(NULL);
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
unsigned int cpu = smp_processor_id();
struct mm_struct *mm = &init_mm;

@@ -405,8 +411,6 @@ void __cpuinit secondary_start_kernel(void)
atomic_inc(&mm->mm_count);
current->active_mm = mm;

- preempt_disable();
-
setup_secondary(cpu);

platform_secondary_init(cpu);
@@ -414,19 +418,17 @@ void __cpuinit secondary_start_kernel(void)
/* setup local core timer */
bfin_local_timer_setup();

- local_irq_enable();
-
bfin_setup_caches(cpu);
+}

- notify_cpu_starting(cpu);
+void __cpuinit __cpu_pre_online(void *unused)
+{
/*
* Calibrate loops per jiffy value.
* IRQs need to be enabled here - D-cache can be invalidated
* in timer irq handler, so core B can read correct jiffies.
*/
calibrate_delay();
-
- cpu_idle();
}

void __init smp_prepare_boot_cpu(void)

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