aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2008-04-28 15:13:43 -0400
committerDave Jones <davej@redhat.com>2008-04-28 15:16:46 -0400
commite56a727b023d40d1adf660168883f30f2e6abe0a (patch)
treeb79841b8f4c79204b160bae2a6a61d8a62019c48 /arch
parentc938ac21329f19ad286eaaed7e26434943c8061b (diff)
[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: Venkatesh Pallipadi <venkatesh.pallipadi@intel.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/acpi-cpufreq.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index e2d870de837c..8db8f73503b3 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -339,6 +339,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
339{ 339{
340 struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu); 340 struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu);
341 unsigned int freq; 341 unsigned int freq;
342 unsigned int cached_freq;
342 343
343 dprintk("get_cur_freq_on_cpu (%d)\n", cpu); 344 dprintk("get_cur_freq_on_cpu (%d)\n", cpu);
344 345
@@ -347,7 +348,16 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
347 return 0; 348 return 0;
348 } 349 }
349 350
351 cached_freq = data->freq_table[data->acpi_data->state].frequency;
350 freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data); 352 freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data);
353 if (freq != cached_freq) {
354 /*
355 * The dreaded BIOS frequency change behind our back.
356 * Force set the frequency on next target call.
357 */
358 data->resume = 1;
359 }
360
351 dprintk("cur freq = %u\n", freq); 361 dprintk("cur freq = %u\n", freq);
352 362
353 return freq; 363 return freq;