diff options
author | Dave Jones <davej@redhat.com> | 2005-05-31 22:03:45 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2005-05-31 22:03:45 -0400 |
commit | 91350ed49bf3613e243c2e216228cd4ae8f32516 (patch) | |
tree | 4c9e99fe077224e678bdd03353d37efe1f5af81e /arch/i386 | |
parent | bf6fc9fd2d848d06b8f6c4caccef1dba9ef8c4c6 (diff) |
[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 <ducrot@poupinou.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index 80f01b00bada..5c530064eb74 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/dmi.h> | 23 | #include <linux/dmi.h> |
24 | 24 | ||
25 | #include <asm/msr.h> | 25 | #include <asm/msr.h> |
26 | #include <asm/timer.h> | ||
26 | #include <asm/timex.h> | 27 | #include <asm/timex.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
@@ -586,8 +587,12 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) | |||
586 | 587 | ||
587 | rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); | 588 | rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); |
588 | 589 | ||
589 | /* A K7 with powernow technology is set to max frequency by BIOS */ | 590 | /* recalibrate cpu_khz */ |
590 | fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID]; | 591 | result = recalibrate_cpu_khz(); |
592 | if (result) | ||
593 | return result; | ||
594 | |||
595 | fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID]; | ||
591 | if (!fsb) { | 596 | if (!fsb) { |
592 | printk(KERN_WARNING PFX "can not determine bus frequency\n"); | 597 | printk(KERN_WARNING PFX "can not determine bus frequency\n"); |
593 | return -EINVAL; | 598 | return -EINVAL; |