Skip to content

Commit

Permalink
[PATCH] x86_64: Make sure hpet_address is 0 when any part of HPET ini…
Browse files Browse the repository at this point in the history
…tialization fails

Otherwise TSC->HPET fallback could see incorrect state and crash later.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Dec 13, 2005
1 parent 7cd082f commit 68e1889
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86_64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int notsc __initdata = 0;
unsigned int cpu_khz; /* TSC clocks / usec, not used here */
static unsigned long hpet_period; /* fsecs / HPET clock */
unsigned long hpet_tick; /* HPET clocks / interrupt */
static int hpet_use_timer;
static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */
unsigned long vxtime_hz = PIT_TICK_RATE;
int report_lost_ticks; /* command line option */
unsigned long long monotonic_base;
Expand Down Expand Up @@ -908,6 +908,8 @@ void __init time_init(void)
if (!hpet_init())
vxtime_hz = (1000000000000000L + hpet_period / 2) /
hpet_period;
else
vxtime.hpet_address = 0;

if (hpet_use_timer) {
cpu_khz = hpet_calibrate_tsc();
Expand Down

0 comments on commit 68e1889

Please sign in to comment.