cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy...
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 31 Oct 2012 00:28:15 +0000 (01:28 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Nov 2012 23:33:09 +0000 (00:33 +0100)
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>
drivers/cpufreq/cpufreq.c

index 261ef654a35254f3e9ef0ecf3a15ba45c6a868c0..28dc134cec3696b4d16ab6ce03995e600190e065 100644 (file)
@@ -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);