From: john stultz <johnstul@us.ibm.com>
Date: Fri, 23 Feb 2007 16:53:27 -0800
While we were discussing this I was debugging my clocksource sparc64
implementation, a shift of 32 didn't work whereas one of 16 (as
in your version of sparc64 support) did. :-)
There is also a very unfortunate inconsistency between how the shift
and multiplier are used in clock sources vs. clock events.
You can initialize your clocksource multiplier using:
mult = clocksource_hz2mult(ticks_per_hz, SHIFT);
but WOE BE TO HE who tries to use that for clockevents (like I
did initially) :-) You have to instead use something like:
mult = div_sc(ticks_per_hz, NSEC_PER_SEC, SHIFT);
I would have been done with the sparc64 dynticks support yesterday if
I didn't trip over all this stuff.
It also isn't clear from the comments that the first argument
to clocksource_hz2mult() and div_sc() is indeed "ticks_per_hz".
I had to gleen over the hpet and LAPIC drivers to kind of figure
this out. Another potential improvement for the comments :-)
-