Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Venkatesh Pallipadi and committed by
Linus Torvalds
4116c527 869f96a0

+4 -1
+4 -1
arch/i386/kernel/timers/timer_hpet.c
··· 136 136 } while ((hpet_end - hpet_start) < (loops)); 137 137 } 138 138 139 + static struct timer_opts timer_hpet; 140 + 139 141 static int __init init_hpet(char* override) 140 142 { 141 143 unsigned long result, remain; ··· 165 163 } 166 164 set_cyc2ns_scale(cpu_khz/1000); 167 165 } 166 + /* set this only when cpu_has_tsc */ 167 + timer_hpet.read_timer = read_timer_tsc; 168 168 } 169 169 170 170 /* ··· 190 186 .get_offset = get_offset_hpet, 191 187 .monotonic_clock = monotonic_clock_hpet, 192 188 .delay = delay_hpet, 193 - .read_timer = read_timer_tsc, 194 189 }; 195 190 196 191 struct init_timer_opts __initdata timer_hpet_init = {