aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2006-10-03 15:36:30 -0400
committerDave Jones <davej@redhat.com>2006-10-15 19:57:11 -0400
commit7650b281b091f39f5e97f13b45ab3813b1526b65 (patch)
tree06b379b4eeb980720e80bb4e6777a090d0163c30
parent64be7eedb2fd0d41614739b265b22708aa81734c (diff)
[CPUFREQ][6/8] acpi-cpufreq: Eliminate get of current freq on notification
Only change the frequency if the state previously set is different from what we are trying to set. We don't really have to get the current frequency at this point. Signed-off-by: Denis Sadykov <denis.m.sadykov@intel.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 385f17aca06b..e6513e994088 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -324,11 +324,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
324 online_policy_cpus = policy->cpus; 324 online_policy_cpus = policy->cpus;
325#endif 325#endif
326 326
327 cmd.val = get_cur_val(online_policy_cpus);
328 freqs.old = extract_freq(cmd.val, data);
329 freqs.new = data->freq_table[next_state].frequency;
330 next_perf_state = data->freq_table[next_state].index; 327 next_perf_state = data->freq_table[next_state].index;
331 if (freqs.new == freqs.old) { 328 if (perf->state == next_perf_state) {
332 if (unlikely(data->resume)) { 329 if (unlikely(data->resume)) {
333 dprintk("Called after resume, resetting to P%d\n", 330 dprintk("Called after resume, resetting to P%d\n",
334 next_perf_state); 331 next_perf_state);
@@ -366,6 +363,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
366 else 363 else
367 cpu_set(policy->cpu, cmd.mask); 364 cpu_set(policy->cpu, cmd.mask);
368 365
366 freqs.old = data->freq_table[perf->state].frequency;
367 freqs.new = data->freq_table[next_perf_state].frequency;
369 for_each_cpu_mask(i, cmd.mask) { 368 for_each_cpu_mask(i, cmd.mask) {
370 freqs.cpu = i; 369 freqs.cpu = i;
371 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 370 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
@@ -613,6 +612,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
613 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); 612 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
614 break; 613 break;
615 case ACPI_ADR_SPACE_FIXED_HARDWARE: 614 case ACPI_ADR_SPACE_FIXED_HARDWARE:
615 acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
616 get_cur_freq_on_cpu(cpu); 616 get_cur_freq_on_cpu(cpu);
617 break; 617 break;
618 default: 618 default:
@@ -687,7 +687,6 @@ static struct freq_attr *acpi_cpufreq_attr[] = {
687static struct cpufreq_driver acpi_cpufreq_driver = { 687static struct cpufreq_driver acpi_cpufreq_driver = {
688 .verify = acpi_cpufreq_verify, 688 .verify = acpi_cpufreq_verify,
689 .target = acpi_cpufreq_target, 689 .target = acpi_cpufreq_target,
690 .get = get_cur_freq_on_cpu,
691 .init = acpi_cpufreq_cpu_init, 690 .init = acpi_cpufreq_cpu_init,
692 .exit = acpi_cpufreq_cpu_exit, 691 .exit = acpi_cpufreq_cpu_exit,
693 .resume = acpi_cpufreq_resume, 692 .resume = acpi_cpufreq_resume,