@@ -207,8 +207,6 @@ static struct clocksource clocksource_tod = {
.rating = 400,
.read = read_tod_clock,
.mask = -1ULL,
- .mult = 1000,
- .shift = 12,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -267,7 +265,16 @@ void __init time_init(void)
if (register_external_interrupt(0x1406, timing_alert_interrupt))
panic("Couldn't request external interrupt 0x1406");
- if (clocksource_register(&clocksource_tod) != 0)
+ /* s390 TOD apparently runs at 4,096,000,000 cycs/sec
+ * XXX - Brute forced tod freq from:
+ * 2^shift/mult * NSEC_PER_SEC = cyc/sec
+ * 2^12 / 1000 * 1000000000 = cyc/sec
+ * 2^12 * 1000000 = cyc/sec
+ * 2^12 * 1000 = kcyc/sec
+ * 1000<<12 = kcyc/sec
+ * Could be totally wrong. -johnstul
+ */
+ if (clocksource_register_khz(&clocksource_tod, (1000<<12) ) != 0)
panic("Could not register TOD clock source");
/* Enable TOD clock interrupts on the boot cpu. */
Converts s390 TOD clock to use clocksource_register_khz The tod freq I calculated seems a bit fast. Need someone to double check me here. CC: Martin Schwidefsky <schwidefsky@de.ibm.com> CC: linux-s390@vger.kernel.org Signed-off-by: John Stultz <john.stultz@linaro.org> --- arch/s390/kernel/time.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)