diff options
author | Naga Chumbalkar <nagananda.chumbalkar@hp.com> | 2009-06-11 11:26:48 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-06-15 11:49:42 -0400 |
commit | 532cfee6ba0a8efcf7c3ce38b9881292d79d516e (patch) | |
tree | f27ca50e349d890aa5853cc0a5ca49d8e6a5e116 /arch | |
parent | b394f1dfc070e6f50f5f33694000815e50ef319d (diff) |
[CPUFREQ] powernow-k8: read P-state from HW
By definition, "cpuinfo_cur_freq" should report the value from HW. So, don't
depend on the cached value. Instead read P-state directly from HW, while
taking into account the erratum 311 workaround for Fam 11h processors.
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Langsdorf, Mark <mark.langsdorf@amd.com>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Reviewed-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Tested-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Langsdorf, Mark <mark.langsdorf@amd.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 2709b3c183b4..331021112f2b 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -118,20 +118,17 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data) | |||
118 | u32 i = 0; | 118 | u32 i = 0; |
119 | 119 | ||
120 | if (cpu_family == CPU_HW_PSTATE) { | 120 | if (cpu_family == CPU_HW_PSTATE) { |
121 | if (data->currpstate == HW_PSTATE_INVALID) { | 121 | rdmsr(MSR_PSTATE_STATUS, lo, hi); |
122 | /* read (initial) hw pstate if not yet set */ | 122 | i = lo & HW_PSTATE_MASK; |
123 | rdmsr(MSR_PSTATE_STATUS, lo, hi); | 123 | data->currpstate = i; |
124 | i = lo & HW_PSTATE_MASK; | 124 | |
125 | 125 | /* | |
126 | /* | 126 | * a workaround for family 11h erratum 311 might cause |
127 | * a workaround for family 11h erratum 311 might cause | 127 | * an "out-of-range Pstate if the core is in Pstate-0 |
128 | * an "out-of-range Pstate if the core is in Pstate-0 | 128 | */ |
129 | */ | 129 | if ((boot_cpu_data.x86 == 0x11) && (i >= data->numps)) |
130 | if (i >= data->numps) | 130 | data->currpstate = HW_PSTATE_0; |
131 | data->currpstate = HW_PSTATE_0; | 131 | |
132 | else | ||
133 | data->currpstate = i; | ||
134 | } | ||
135 | return 0; | 132 | return 0; |
136 | } | 133 | } |
137 | do { | 134 | do { |