Skip to content

Commit

Permalink
ARM: 7133/1: SMP: fix per cpu timer setup before the cpu is marked on…
Browse files Browse the repository at this point in the history
…line

The problem is related to the early enabling of interrupts and the
per cpu timer setup before the cpu is marked online. This doesn't
need to be done in order to call calibrate_delay().

calibrate_delay() monitors jiffies, which are updated from the CPU
which is waiting for the new CPU to set the online bit.

So simply calibrate_delay() can be called on the new CPU just from
the interrupt disabled region and move the local timer setup after
stored the cpu data and before enabling interrupts.

This solves both the cpu_online vs. cpu_active problem and the
affinity setting of the per cpu timers.

Signed-off-by: Thomas Gleinxer <tglx@linutronix.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Thomas Gleinxer authored and Russell King committed Oct 23, 2011
1 parent 6c5482d commit eb04745
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
*/
platform_secondary_init(cpu);

/*
* Enable local interrupts.
*/
notify_cpu_starting(cpu);
local_irq_enable();
local_fiq_enable();

/*
* Setup the percpu timer for this CPU.
*/
percpu_timer_setup();

calibrate_delay();

Expand All @@ -323,9 +313,22 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
* before we continue.
*/
set_cpu_online(cpu, true);

/*
* Setup the percpu timer for this CPU.
*/
percpu_timer_setup();

while (!cpu_active(cpu))
cpu_relax();

/*
* cpu_active bit is set, so it's safe to enalbe interrupts
* now.
*/
local_irq_enable();
local_fiq_enable();

/*
* OK, it's off to the idle thread for us
*/
Expand Down

0 comments on commit eb04745

Please sign in to comment.