Most recent kernel where this bug did not occur: None known Distribution: kernel.org kernel Hardware Environment: i386 Software Environment: boot with clock=pit on the command line Problem Description: 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. Patch below. Steps to reproduce: Boot with clock=pit on the kernel command line. Patch (tested briefly and seems to work fine): --- arch/i386/kernel/timers/timer_pit.c~ 2005-08-24 18:54:21.000000000 -0700 +++ arch/i386/kernel/timers/timer_pit.c 2005-11-03 18:51:17.000000000 -0800 @@ -29,6 +29,9 @@ printk(KERN_ERR "Warning: clock= override failed. Defaulting toPIT\n"); count_p = LATCH; + + init_cpu_khz(); + return 0; }
Looks like Andrew sent this patch to Linus, would you mind testing with tonight's -git release and verify that it is working properly for you?
This has been in mainline for a month now, I'm considering it closed.
I finally got a chance to check, and I can confirm it's fixed (tested in 2.6.16.9). Sorry it took so long to confirm, and thanks for the fix.