diff options
Diffstat (limited to 'arch/arm/kernel/smp.c')
| -rw-r--r-- | arch/arm/kernel/smp.c | 33 | 
1 files changed, 20 insertions, 13 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 2cee7d1eb95..8f464465977 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)  	struct mm_struct *mm = &init_mm;  	unsigned int cpu = smp_processor_id(); -	printk("CPU%u: Booted secondary processor\n", cpu); -  	/*  	 * All kernel threads share the same mm context; grab a  	 * reference and switch to it. @@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)  	enter_lazy_tlb(mm, current);  	local_flush_tlb_all(); +	printk("CPU%u: Booted secondary processor\n", cpu); +  	cpu_init();  	preempt_disable();  	trace_hardirqs_off(); @@ -349,7 +349,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)  		 * re-initialize the map in platform_smp_prepare_cpus() if  		 * present != possible (e.g. physical hotplug).  		 */ -		init_cpu_present(&cpu_possible_map); +		init_cpu_present(cpu_possible_mask);  		/*  		 * Initialise the SCU if there are more than one CPU @@ -510,10 +510,6 @@ static void ipi_cpu_stop(unsigned int cpu)  	local_fiq_disable();  	local_irq_disable(); -#ifdef CONFIG_HOTPLUG_CPU -	platform_cpu_kill(cpu); -#endif -  	while (1)  		cpu_relax();  } @@ -576,16 +572,25 @@ void smp_send_reschedule(int cpu)  	smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE);  } +#ifdef CONFIG_HOTPLUG_CPU +static void smp_kill_cpus(cpumask_t *mask) +{ +	unsigned int cpu; +	for_each_cpu(cpu, mask) +		platform_cpu_kill(cpu); +} +#else +static void smp_kill_cpus(cpumask_t *mask) { } +#endif +  void smp_send_stop(void)  {  	unsigned long timeout; +	struct cpumask mask; -	if (num_online_cpus() > 1) { -		cpumask_t mask = cpu_online_map; -		cpu_clear(smp_processor_id(), mask); - -		smp_cross_call(&mask, IPI_CPU_STOP); -	} +	cpumask_copy(&mask, cpu_online_mask); +	cpumask_clear_cpu(smp_processor_id(), &mask); +	smp_cross_call(&mask, IPI_CPU_STOP);  	/* Wait up to one second for other CPUs to stop */  	timeout = USEC_PER_SEC; @@ -594,6 +599,8 @@ void smp_send_stop(void)  	if (num_online_cpus() > 1)  		pr_warning("SMP: failed to stop secondary CPUs\n"); + +	smp_kill_cpus(&mask);  }  /*  |