clocksource: Add clocksource_register_hz/khz interface
authorJohn Stultz <johnstul@us.ibm.com>
Sat, 8 May 2010 01:07:38 +0000 (18:07 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 10 May 2010 12:24:26 +0000 (14:24 +0200)
commitd7e81c269db899b800e0963dc4aceece1f82a680
treebf30c8c5ed86dbf3c71a25e0f3ab1093c19e516f
parent29f87b793da421a6ab816d991dc8dbf909dfb66a
clocksource: Add clocksource_register_hz/khz interface

How to pick good mult/shift pairs has always been difficult to
describe to folks writing clocksource drivers, since it requires
careful tradeoffs in adjustment accuracy vs overflow limits.

Now, with the clocks_calc_mult_shift function, its much
easier. However, not many clocksources have converted to using that
function, and there is still the issue of the max interval length
assumption being made by each clocksource driver independently.

So this patch simplifies the registration process by having
clocksources be registered with a hz/khz value and the registration
function taking care of setting mult/shift.

This should take most of the confusion out of writing a clocksource
driver.

Additionally it also keeps the shift size tradeoff (more accuracy vs
longer possible nohz times) centralized so the timekeeping core can
keep track of the assumptions being made.

[ tglx: Coding style and comments fixed ]

Signed-off-by: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <1273280858-30143-1-git-send-email-johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/clocksource.h
kernel/time/clocksource.c