[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>
This commit is contained in:
Konrad Rzeszutek Wilk 2011-06-16 15:36:40 -04:00 коммит произвёл Dave Jones
Родитель a9d3d20680
Коммит fbb5b89eab
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1104,7 +1104,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
/* get MSR index for hardware pstate transition */ /* get MSR index for hardware pstate transition */
pstate = index & HW_PSTATE_MASK; pstate = index & HW_PSTATE_MASK;
if (pstate > data->max_hw_pstate) if (pstate > data->max_hw_pstate)
return 0; return -EINVAL;
freqs.old = find_khz_freq_from_pstate(data->powernow_table, freqs.old = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate); data->currpstate);
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate); freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);