aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-07-28 12:16:39 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-01 14:24:54 +0200
commit99d14d0e16fadb4de001bacc0ac0786a9ebecf2a (patch)
treef09808829ea602773845903f05ca6699b5fb16c6 /include/linux/cpufreq.h
parentsched: cpufreq: Allow remote cpufreq callbacks (diff)
downloadlinux-dev-99d14d0e16fadb4de001bacc0ac0786a9ebecf2a.tar.xz
linux-dev-99d14d0e16fadb4de001bacc0ac0786a9ebecf2a.zip
cpufreq: Process remote callbacks from any CPU if the platform permits
On many platforms, CPUs can do DVFS across cpufreq policies. i.e CPU from policy-A can change frequency of CPUs belonging to policy-B. This is quite common in case of ARM platforms where we don't configure any per-cpu register. Add a flag to identify such platforms and update cpufreq_can_do_remote_dvfs() to allow remote callbacks if this flag is set. Also enable the flag for cpufreq-dt driver which is used only on ARM platforms currently. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Saravana Kannan <skannan@codeaurora.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c4035964e6b3..1981a4a167ce 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -127,6 +127,15 @@ struct cpufreq_policy {
*/
unsigned int transition_delay_us;
+ /*
+ * Remote DVFS flag (Not added to the driver structure as we don't want
+ * to access another structure from scheduler hotpath).
+ *
+ * Should be set if CPUs can do DVFS on behalf of other CPUs from
+ * different cpufreq policies.
+ */
+ bool dvfs_possible_from_any_cpu;
+
/* Cached frequency lookup from cpufreq_driver_resolve_freq. */
unsigned int cached_target_freq;
int cached_resolved_idx;
@@ -564,8 +573,13 @@ struct governor_attr {
static inline bool cpufreq_can_do_remote_dvfs(struct cpufreq_policy *policy)
{
- /* Allow remote callbacks only on the CPUs sharing cpufreq policy */
- if (cpumask_test_cpu(smp_processor_id(), policy->cpus))
+ /*
+ * Allow remote callbacks if:
+ * - dvfs_possible_from_any_cpu flag is set
+ * - the local and remote CPUs share cpufreq policy
+ */
+ if (policy->dvfs_possible_from_any_cpu ||
+ cpumask_test_cpu(smp_processor_id(), policy->cpus))
return true;
return false;