Skip to content

Commit fbb5b89

Browse files
konradwilkDave Jones
authored andcommitted
[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>
1 parent a9d3d20 commit fbb5b89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/cpufreq/powernow-k8.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
11041104
/* get MSR index for hardware pstate transition */
11051105
pstate = index & HW_PSTATE_MASK;
11061106
if (pstate > data->max_hw_pstate)
1107-
return 0;
1107+
return -EINVAL;
1108+
11081109
freqs.old = find_khz_freq_from_pstate(data->powernow_table,
11091110
data->currpstate);
11101111
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);

0 commit comments

Comments
 (0)