summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-06-16 15:36:40 -0400
committerDave Jones <davej@redhat.com>2011-06-16 16:31:13 -0400
commitfbb5b89eabea5ae7d621b7861863159560d8faa4 (patch)
tree51e3d877cb3457bcd801175fb455927fd52f2d2b /drivers/cpufreq
parenta9d3d2068064b7a6395871a49616d3784f802d50 (diff)
downloadop-kernel-dev-fbb5b89eabea5ae7d621b7861863159560d8faa4.zip
op-kernel-dev-fbb5b89eabea5ae7d621b7861863159560d8faa4.tar.gz
[CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect
This patch augments the pstate transition code to error out (instead of returning 0) when an incorrect pstate is provided. Suggested-by: Borislav Petkov <bp@alien8.de> CC: andre.przywara@amd.com CC: Mark.Langsdorf@amd.com Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/powernow-k8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 287c56f..bce576d 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1104,7 +1104,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
/* get MSR index for hardware pstate transition */
pstate = index & HW_PSTATE_MASK;
if (pstate > data->max_hw_pstate)
- return 0;
+ return -EINVAL;
+
freqs.old = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate);
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
OpenPOWER on IntegriCloud