From: Venkatesh Pallipadi Date: Sat, 3 Sep 2005 22:56:27 +0000 (-0700) Subject: [PATCH] hpet: use read_timer_tsc only when CPU has TSC X-Git-Tag: v2.6.14-rc1~866 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4116c527ea9517623369a5b3b037aedde280d672;p=linux-2.6-omap-h63xx.git [PATCH] hpet: use read_timer_tsc only when CPU has TSC Only use read_timer_tsc only when CPU has TSC. Thanks to Andrea for pointing this out. Should not be issue on any platforms as all recent systems that has HPET also has CPUs that supports TSC. The patch is still required for correctness. Signed-off-by: Venkatesh Pallipadi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c index ef8dac5dd33..cbb3f221ced 100644 --- a/arch/i386/kernel/timers/timer_hpet.c +++ b/arch/i386/kernel/timers/timer_hpet.c @@ -136,6 +136,8 @@ static void delay_hpet(unsigned long loops) } while ((hpet_end - hpet_start) < (loops)); } +static struct timer_opts timer_hpet; + static int __init init_hpet(char* override) { unsigned long result, remain; @@ -163,6 +165,8 @@ static int __init init_hpet(char* override) } set_cyc2ns_scale(cpu_khz/1000); } + /* set this only when cpu_has_tsc */ + timer_hpet.read_timer = read_timer_tsc; } /* @@ -186,7 +190,6 @@ static struct timer_opts timer_hpet __read_mostly = { .get_offset = get_offset_hpet, .monotonic_clock = monotonic_clock_hpet, .delay = delay_hpet, - .read_timer = read_timer_tsc, }; struct init_timer_opts __initdata timer_hpet_init = {