Skip to content

Commit

Permalink
powerpc: Fix SMP time initialization problem
Browse files Browse the repository at this point in the history
We were getting the last_jiffy per-cpu variable set ahead of the current
timebase in smp_space_timers on SMP machines.  This caused the loop in
timer_interrupt to loop virtually forever, since tb_ticks_since assumes
that it will never be called with the timebase behind the last_jiffy
value.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Nov 10, 2005
1 parent 094fe2e commit cbe62e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ void __init smp_space_timers(unsigned int max_cpus)
unsigned long offset = tb_ticks_per_jiffy / max_cpus;
unsigned long previous_tb = per_cpu(last_jiffy, boot_cpuid);

/* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */
previous_tb -= tb_ticks_per_jiffy;
for_each_cpu(i) {
if (i != boot_cpuid) {
previous_tb += offset;
Expand Down

0 comments on commit cbe62e2

Please sign in to comment.