Skip to content

Commit

Permalink
cpufreq: Avoid calling cpufreq driver's target() routine if target_fr…
Browse files Browse the repository at this point in the history
…eq == 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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Nov 14, 2012
1 parent da58445 commit 5a1c022
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5a1c022

Please sign in to comment.