Skip to content

Commit 5a1c022

Browse files
vireshkrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent da58445 commit 5a1c022

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,10 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
14761476

14771477
pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
14781478
target_freq, relation);
1479+
1480+
if (target_freq == policy->cur)
1481+
return 0;
1482+
14791483
if (cpu_online(policy->cpu) && cpufreq_driver->target)
14801484
retval = cpufreq_driver->target(policy, target_freq, relation);
14811485

0 commit comments

Comments
 (0)