diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2012-10-31 01:28:15 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-15 00:33:09 +0100 |
commit | 5a1c022850ea5d64c2997bf9b89f5ae112d5ee4d (patch) | |
tree | a6ee4f063d362d456fe3e8c8475bf441aa51dfd8 /drivers/cpufreq/cpufreq.c | |
parent | da58445570326ac2a342770a9c9a2646276e1721 (diff) | |
download | blackbird-op-linux-5a1c022850ea5d64c2997bf9b89f5ae112d5ee4d.tar.gz blackbird-op-linux-5a1c022850ea5d64c2997bf9b89f5ae112d5ee4d.zip |
cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
Avoid calling cpufreq driver's target() routine if new frequency is same as
policies current frequency.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 261ef654a352..28dc134cec36 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1476,6 +1476,10 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu, target_freq, relation); + + if (target_freq == policy->cur) + return 0; + if (cpu_online(policy->cpu) && cpufreq_driver->target) retval = cpufreq_driver->target(policy, target_freq, relation); |