提交 e56a727b 编写于 作者: V Venkatesh Pallipadi 提交者: Dave Jones

[CPUFREQ] Make acpi-cpufreq more robust against BIOS freq changes behind our back.

We checked the hardware freq with OS cached freq value in get_cur_freqon_cpu().
Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: NThomas Renninger <trenn@suse.de>
Signed-off-by: NDave Jones <davej@redhat.com>
上级 c938ac21
...@@ -339,6 +339,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) ...@@ -339,6 +339,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
{ {
struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu); struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu);
unsigned int freq; unsigned int freq;
unsigned int cached_freq;
dprintk("get_cur_freq_on_cpu (%d)\n", cpu); dprintk("get_cur_freq_on_cpu (%d)\n", cpu);
...@@ -347,7 +348,16 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) ...@@ -347,7 +348,16 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
return 0; return 0;
} }
cached_freq = data->freq_table[data->acpi_data->state].frequency;
freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data); freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data);
if (freq != cached_freq) {
/*
* The dreaded BIOS frequency change behind our back.
* Force set the frequency on next target call.
*/
data->resume = 1;
}
dprintk("cur freq = %u\n", freq); dprintk("cur freq = %u\n", freq);
return freq; return freq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册