diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2017-07-19 06:12:42 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-21 20:25:20 -0400 |
commit | aa7519af450d3c62a057aece24877c34562fa25a (patch) | |
tree | 664a918cbe1bcd0de3e162f247197946ff578001 /kernel | |
parent | 2d045036322c29b69c22f06530f1130338d06373 (diff) |
cpufreq: Use transition_delay_us for legacy governors as well
The policy->transition_delay_us field is used only by the schedutil
governor currently, and this field describes how fast the driver wants
the cpufreq governor to change CPUs frequency. It should rather be a
common thing across all governors, as it doesn't have any schedutil
dependency here.
Create a new helper cpufreq_policy_transition_delay_us() to get the
transition delay across all governors.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 29a397067ffa..89c4dd9777bb 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
@@ -528,16 +528,7 @@ static int sugov_init(struct cpufreq_policy *policy) | |||
528 | goto stop_kthread; | 528 | goto stop_kthread; |
529 | } | 529 | } |
530 | 530 | ||
531 | if (policy->transition_delay_us) { | 531 | tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); |
532 | tunables->rate_limit_us = policy->transition_delay_us; | ||
533 | } else { | ||
534 | unsigned int lat; | ||
535 | |||
536 | tunables->rate_limit_us = LATENCY_MULTIPLIER; | ||
537 | lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC; | ||
538 | if (lat) | ||
539 | tunables->rate_limit_us *= lat; | ||
540 | } | ||
541 | 532 | ||
542 | policy->governor_data = sg_policy; | 533 | policy->governor_data = sg_policy; |
543 | sg_policy->tunables = tunables; | 534 | sg_policy->tunables = tunables; |