diff options
| author | Andi Kleen <ak@suse.de> | 2005-12-13 01:17:07 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-13 01:31:16 -0500 |
| commit | 68e188911263adb06e28fa2c9dc9e017774de68d (patch) | |
| tree | 159e570339af78445cd91f4fa8f3a426bf4a9aa6 | |
| parent | 7cd082f0147c5fc94b455bcc17fe21b22dbac703 (diff) | |
[PATCH] x86_64: Make sure hpet_address is 0 when any part of HPET initialization 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>
| -rw-r--r-- | arch/x86_64/kernel/time.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index fdaddc4e5284..4434e154f596 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
| @@ -59,7 +59,7 @@ static int notsc __initdata = 0; | |||
| 59 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ | 59 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ |
| 60 | static unsigned long hpet_period; /* fsecs / HPET clock */ | 60 | static unsigned long hpet_period; /* fsecs / HPET clock */ |
| 61 | unsigned long hpet_tick; /* HPET clocks / interrupt */ | 61 | unsigned long hpet_tick; /* HPET clocks / interrupt */ |
| 62 | static int hpet_use_timer; | 62 | static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ |
| 63 | unsigned long vxtime_hz = PIT_TICK_RATE; | 63 | unsigned long vxtime_hz = PIT_TICK_RATE; |
| 64 | int report_lost_ticks; /* command line option */ | 64 | int report_lost_ticks; /* command line option */ |
| 65 | unsigned long long monotonic_base; | 65 | unsigned long long monotonic_base; |
| @@ -908,6 +908,8 @@ void __init time_init(void) | |||
| 908 | if (!hpet_init()) | 908 | if (!hpet_init()) |
| 909 | vxtime_hz = (1000000000000000L + hpet_period / 2) / | 909 | vxtime_hz = (1000000000000000L + hpet_period / 2) / |
| 910 | hpet_period; | 910 | hpet_period; |
| 911 | else | ||
| 912 | vxtime.hpet_address = 0; | ||
| 911 | 913 | ||
| 912 | if (hpet_use_timer) { | 914 | if (hpet_use_timer) { |
| 913 | cpu_khz = hpet_calibrate_tsc(); | 915 | cpu_khz = hpet_calibrate_tsc(); |
