linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 26/27] arm, smpboot: Use generic SMP booting infrastructure
       [not found] <20120601090952.31979.24799.stgit@srivatsabhat.in.ibm.com>
@ 2012-06-01  9:16 ` Srivatsa S. Bhat
  2012-06-01 11:04   ` Russell King - ARM Linux
  0 siblings, 1 reply; 2+ messages in thread
From: Srivatsa S. Bhat @ 2012-06-01  9:16 UTC (permalink / raw)
  To: linux-arm-kernel

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

Notes:
The calls to local_irq_enable() and local_fiq_enable() which were there
in secondary_start_kernel() originally, are retained in __cpu_post_online()
since the generic code only calls local_irq_enable().
Also, we were anyway going to enable interrupts in the generic code
immediately after __cpu_post_online(), so its not like we enabled interrupts
way too early.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Brown <davidb@codeaurora.org>
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

 arch/arm/kernel/smp.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index b735521..460b7e7 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -25,6 +25,7 @@
 #include <linux/percpu.h>
 #include <linux/clockchips.h>
 #include <linux/completion.h>
+#include <linux/smpboot.h>
 
 #include <linux/atomic.h>
 #include <asm/cacheflush.h>
@@ -227,6 +228,11 @@ static void percpu_timer_setup(void);
  */
 asmlinkage void __cpuinit secondary_start_kernel(void)
 {
+	smpboot_start_secondary(NULL);
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
 	struct mm_struct *mm = &init_mm;
 	unsigned int cpu = smp_processor_id();
 
@@ -244,26 +250,25 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 	printk("CPU%u: Booted secondary processor\n", cpu);
 
 	cpu_init();
-	preempt_disable();
 	trace_hardirqs_off();
 
 	/*
 	 * Give the platform a chance to do its own initialisation.
 	 */
 	platform_secondary_init(cpu);
+}
 
-	notify_cpu_starting(cpu);
+void __cpuinit __cpu_pre_online(void *unused)
+{
+	unsigned int cpu = smp_processor_id();
 
 	calibrate_delay();
 
 	smp_store_cpu_info(cpu);
+}
 
-	/*
-	 * OK, now it's safe to let the boot CPU continue.  Wait for
-	 * the CPU migration code to notice that the CPU is online
-	 * before we continue - which happens after __cpu_up returns.
-	 */
-	set_cpu_online(cpu, true);
+void __cpuinit __cpu_post_online(void *unused)
+{
 	complete(&cpu_running);
 
 	/*
@@ -273,11 +278,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 
 	local_irq_enable();
 	local_fiq_enable();
-
-	/*
-	 * OK, it's off to the idle thread for us
-	 */
-	cpu_idle();
 }
 
 void __init smp_cpus_done(unsigned int max_cpus)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 26/27] arm, smpboot: Use generic SMP booting infrastructure
  2012-06-01  9:16 ` [PATCH 26/27] arm, smpboot: Use generic SMP booting infrastructure Srivatsa S. Bhat
@ 2012-06-01 11:04   ` Russell King - ARM Linux
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2012-06-01 11:04 UTC (permalink / raw)
  To: linux-arm-kernel

If you're expecting an ack from me, you're not going to get it because
this patch is useless on its own.  It can't be reviewed and it can't be
tested without the rest of the series.

On Fri, Jun 01, 2012 at 02:46:20PM +0530, Srivatsa S. Bhat wrote:
> Convert arm to use the generic framework to boot secondary CPUs.
> 
> Notes:
> The calls to local_irq_enable() and local_fiq_enable() which were there
> in secondary_start_kernel() originally, are retained in __cpu_post_online()
> since the generic code only calls local_irq_enable().
> Also, we were anyway going to enable interrupts in the generic code
> immediately after __cpu_post_online(), so its not like we enabled interrupts
> way too early.
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> ---
> 
>  arch/arm/kernel/smp.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index b735521..460b7e7 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -25,6 +25,7 @@
>  #include <linux/percpu.h>
>  #include <linux/clockchips.h>
>  #include <linux/completion.h>
> +#include <linux/smpboot.h>
>  
>  #include <linux/atomic.h>
>  #include <asm/cacheflush.h>
> @@ -227,6 +228,11 @@ static void percpu_timer_setup(void);
>   */
>  asmlinkage void __cpuinit secondary_start_kernel(void)
>  {
> +	smpboot_start_secondary(NULL);
> +}
> +
> +void __cpuinit __cpu_pre_starting(void *unused)
> +{
>  	struct mm_struct *mm = &init_mm;
>  	unsigned int cpu = smp_processor_id();
>  
> @@ -244,26 +250,25 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
>  	printk("CPU%u: Booted secondary processor\n", cpu);
>  
>  	cpu_init();
> -	preempt_disable();
>  	trace_hardirqs_off();
>  
>  	/*
>  	 * Give the platform a chance to do its own initialisation.
>  	 */
>  	platform_secondary_init(cpu);
> +}
>  
> -	notify_cpu_starting(cpu);
> +void __cpuinit __cpu_pre_online(void *unused)
> +{
> +	unsigned int cpu = smp_processor_id();
>  
>  	calibrate_delay();
>  
>  	smp_store_cpu_info(cpu);
> +}
>  
> -	/*
> -	 * OK, now it's safe to let the boot CPU continue.  Wait for
> -	 * the CPU migration code to notice that the CPU is online
> -	 * before we continue - which happens after __cpu_up returns.
> -	 */
> -	set_cpu_online(cpu, true);
> +void __cpuinit __cpu_post_online(void *unused)
> +{
>  	complete(&cpu_running);
>  
>  	/*
> @@ -273,11 +278,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
>  
>  	local_irq_enable();
>  	local_fiq_enable();
> -
> -	/*
> -	 * OK, it's off to the idle thread for us
> -	 */
> -	cpu_idle();
>  }
>  
>  void __init smp_cpus_done(unsigned int max_cpus)
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-01 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120601090952.31979.24799.stgit@srivatsabhat.in.ibm.com>
2012-06-01  9:16 ` [PATCH 26/27] arm, smpboot: Use generic SMP booting infrastructure Srivatsa S. Bhat
2012-06-01 11:04   ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).