From cad1b17a6dd4b6acf01c11be5524798e43140132 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Thu, 16 Sep 2004 22:15:53 -0700 Subject: [PATCH] [PATCH] time interpolators logic fix Report the resolution of the time source correctly for time interpolators with a frequency over 1 Ghz. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/timer.c b/kernel/timer.c index 7f71bb07c750e..36e40d8b182d4 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1492,7 +1492,10 @@ void time_interpolator_reset(void) unsigned long time_interpolator_resolution(void) { - return NSEC_PER_SEC / time_interpolator->frequency; + if (time_interpolator->frequency < NSEC_PER_SEC) + return NSEC_PER_SEC / time_interpolator->frequency; + else + return 1; } #define GET_TI_NSECS(count,i) ((((count) - i->last_counter) * i->nsec_per_cyc) >> i->shift) -- 2.53.0