diff options
author | Steve Muckle <steve.muckle@linaro.org> | 2016-07-13 22:25:27 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-07-21 22:28:32 +0200 |
commit | 5b6667c76d39e325d3c05b1f7e40f8a0e4bd6681 (patch) | |
tree | 7a8384759382e0d91cd7db9d71684e98b153f2cf | |
parent | cpufreq: schedutil: map raw required frequency to driver frequency (diff) | |
download | linux-5b6667c76d39e325d3c05b1f7e40f8a0e4bd6681.tar.xz linux-5b6667c76d39e325d3c05b1f7e40f8a0e4bd6681.zip |
cpufreq: acpi-cpufreq: use cached frequency mapping when possible
A call to cpufreq_driver_resolve_freq will cache the mapping from
the desired target frequency to the frequency table index. If there
is a mapping for the desired target frequency then use it instead of
looking up the mapping again.
Signed-off-by: Steve Muckle <smuckle@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/acpi-cpufreq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 11c9a078e0fd..297e9128fe9f 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -473,7 +473,10 @@ unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy, /* * Find the closest frequency above target_freq. */ - index = cpufreq_table_find_index_dl(policy, target_freq); + if (policy->cached_target_freq == target_freq) + index = policy->cached_resolved_idx; + else + index = cpufreq_table_find_index_dl(policy, target_freq); entry = &policy->freq_table[index]; next_freq = entry->frequency; |