aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
authorTim Mann <mann@vmware.com>2005-11-13 19:06:54 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-13 21:14:13 -0500
commit7feacd53347c04aee789ba5d632eda0c3fc421c4 (patch)
tree87050958ebdacb288dac2c1939e08149a0623b23 /arch/i386/kernel
parente27182088e607880713d9c286a3d92d861c280e4 (diff)
[PATCH] x86: fix cpu_khz with clock=pit
Fix http://bugzilla.kernel.org/show_bug.cgi?id=5546 The cpu_khz global is not initialized and remains 0 if you boot with clock=pit, even if the processor does have a TSC. This may have bad ramifications since the variable is used in various places scattered around the kernel, though I didn't check them all to see if they can tolerate cpu_khz = 0. You can observe the problem by doing "cat /proc/cpuinfo"; the cpu MHz line says 0.000. The fix is trivial; call init_cpu_khz() from init_pit(), just as it's called from the timers/timer_foo.c:init_foo() for other values of foo. Cc: john stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/timers/timer_pit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
index e42e46d35159..b9b6bd56b9ba 100644
--- a/arch/i386/kernel/timers/timer_pit.c
+++ b/arch/i386/kernel/timers/timer_pit.c
@@ -25,8 +25,9 @@ static int __init init_pit(char* override)
25{ 25{
26 /* check clock override */ 26 /* check clock override */
27 if (override[0] && strncmp(override,"pit",3)) 27 if (override[0] && strncmp(override,"pit",3))
28 printk(KERN_ERR "Warning: clock= override failed. Defaulting to PIT\n"); 28 printk(KERN_ERR "Warning: clock= override failed. Defaulting "
29 29 "to PIT\n");
30 init_cpu_khz();
30 count_p = LATCH; 31 count_p = LATCH;
31 return 0; 32 return 0;
32} 33}