Commit 7650b281 authored by Venkatesh Pallipadi's avatar Venkatesh Pallipadi Committed by Dave Jones

[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: default avatarDenis Sadykov <denis.m.sadykov@intel.com>
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 64be7eed
...@@ -324,11 +324,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, ...@@ -324,11 +324,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
online_policy_cpus = policy->cpus; online_policy_cpus = policy->cpus;
#endif #endif
cmd.val = get_cur_val(online_policy_cpus);
freqs.old = extract_freq(cmd.val, data);
freqs.new = data->freq_table[next_state].frequency;
next_perf_state = data->freq_table[next_state].index; next_perf_state = data->freq_table[next_state].index;
if (freqs.new == freqs.old) { if (perf->state == next_perf_state) {
if (unlikely(data->resume)) { if (unlikely(data->resume)) {
dprintk("Called after resume, resetting to P%d\n", dprintk("Called after resume, resetting to P%d\n",
next_perf_state); next_perf_state);
...@@ -366,6 +363,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, ...@@ -366,6 +363,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
else else
cpu_set(policy->cpu, cmd.mask); cpu_set(policy->cpu, cmd.mask);
freqs.old = data->freq_table[perf->state].frequency;
freqs.new = data->freq_table[next_perf_state].frequency;
for_each_cpu_mask(i, cmd.mask) { for_each_cpu_mask(i, cmd.mask) {
freqs.cpu = i; freqs.cpu = i;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
...@@ -613,6 +612,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -613,6 +612,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
break; break;
case ACPI_ADR_SPACE_FIXED_HARDWARE: case ACPI_ADR_SPACE_FIXED_HARDWARE:
acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
get_cur_freq_on_cpu(cpu); get_cur_freq_on_cpu(cpu);
break; break;
default: default:
...@@ -687,7 +687,6 @@ static struct freq_attr *acpi_cpufreq_attr[] = { ...@@ -687,7 +687,6 @@ static struct freq_attr *acpi_cpufreq_attr[] = {
static struct cpufreq_driver acpi_cpufreq_driver = { static struct cpufreq_driver acpi_cpufreq_driver = {
.verify = acpi_cpufreq_verify, .verify = acpi_cpufreq_verify,
.target = acpi_cpufreq_target, .target = acpi_cpufreq_target,
.get = get_cur_freq_on_cpu,
.init = acpi_cpufreq_cpu_init, .init = acpi_cpufreq_cpu_init,
.exit = acpi_cpufreq_cpu_exit, .exit = acpi_cpufreq_cpu_exit,
.resume = acpi_cpufreq_resume, .resume = acpi_cpufreq_resume,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment