Skip to content

Commit

Permalink
[PATCH] ppc: Fix timekeeping with HZ=250 on some Mac models
Browse files Browse the repository at this point in the history
Older Macs which uses the VIA chip timers to calibrate the timebase used
some code that wouldn't work if HZ wasn't divisible by 100...

This fixes it at least for 250.  Not totally perfect but should be
enough for now (so it at least works with the default value which is now
250).

There is still a potential issue with the core using CLOCK_TICK_RATE to
maintain xtime and CLOCK_TICK_RATE value on ppc32 is pure crap, but that
is a different problem, this patch at least brings us back to our
previous situation.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ozbenh authored and Linus Torvalds committed Oct 5, 2005
1 parent 329d4dd commit 23cb8c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/ppc/platforms/pmac_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ via_calibrate_decr(void)
;
dend = get_dec();

tb_ticks_per_jiffy = (dstart - dend) / (6 * (HZ/100));
tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100);
tb_to_us = mulhwu_scale_factor(dstart - dend, 60000);

printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %u (%u ticks)\n",
Expand Down

0 comments on commit 23cb8c2

Please sign in to comment.