[CPUFREQ] Recalibrate cpu_khz [1/2] We have to recalibrate cpu_khz in order to use the current FID instead the max FID since some BIOS do not put the processor at maximum frequency at POST. Also, some BIOS will change the processor frequency at our back after cpu_khz was calibrate. Finally, this will fix a long standing bug when we do something like this: # rmmod powernow-k7 # modprobe powernow-k7 Signed-off-by: Bruno Ducrot Signed-off-by: Andrew Morton Signed-off-by: Dave Jones --- 25-akpm/arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff -puN arch/i386/kernel/cpu/cpufreq/powernow-k7.c~powernow-k7recalibrate-cpu_khz arch/i386/kernel/cpu/cpufreq/powernow-k7.c --- 25/arch/i386/kernel/cpu/cpufreq/powernow-k7.c~powernow-k7recalibrate-cpu_khz Wed Mar 30 13:17:41 2005 +++ 25-akpm/arch/i386/kernel/cpu/cpufreq/powernow-k7.c Wed Mar 30 13:17:41 2005 @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -586,8 +587,12 @@ static int __init powernow_cpu_init (str rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); - /* A K7 with powernow technology is set to max frequency by BIOS */ - fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID]; + /* recalibrate cpu_khz */ + result = recalibrate_cpu_khz(); + if (result) + return result; + + fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID]; if (!fsb) { printk(KERN_WARNING PFX "can not determine bus frequency\n"); return -EINVAL; _