diff options
author | Paul Mackerras <paulus@samba.org> | 2007-10-11 07:46:45 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-11 07:49:23 -0400 |
commit | cdec12aebe1b10aa58bebaa05bb697843154f7f9 (patch) | |
tree | 5396af2e100d9a32bbc9a66bae324e3270fe900e | |
parent | d968014b7280e2c447b20363e576999040ac72ef (diff) |
[POWERPC] Make clockevents work on PPC601 processors
In testing the new clocksource and clockevent code on a PPC601
processor, I discovered that the clockevent multiplier value for the
decrementer clockevent was overflowing. Because the RTCL register in
the 601 effectively counts at 1GHz (it doesn't actually, but it
increases by 128 every 128ns), and the shift value was 32, that meant
the multiplier value had to be 2^32, which won't fit in an unsigned
long on 32-bit. The same problem would arise on any platform where
the timebase frequency was 1GHz or more (not that we actually have any
such machines today).
This fixes it by reducing the shift value to 16. Doing the
calculations with a resolution of 2^-16 nanoseconds (15 femtoseconds)
should be quite adequate. :)
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/time.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 64b503c82a31..9368da371f36 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -108,7 +108,7 @@ static void decrementer_set_mode(enum clock_event_mode mode, | |||
108 | static struct clock_event_device decrementer_clockevent = { | 108 | static struct clock_event_device decrementer_clockevent = { |
109 | .name = "decrementer", | 109 | .name = "decrementer", |
110 | .rating = 200, | 110 | .rating = 200, |
111 | .shift = 32, | 111 | .shift = 16, |
112 | .mult = 0, /* To be filled in */ | 112 | .mult = 0, /* To be filled in */ |
113 | .irq = 0, | 113 | .irq = 0, |
114 | .set_next_event = decrementer_set_next_event, | 114 | .set_next_event = decrementer_set_next_event, |