summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Turquette <mturquette@baylibre.com>2015-06-30 12:45:27 +0100
committerLeo Yan <leo.yan@linaro.org>2016-05-10 16:49:55 +0800
commitc3b2e765af4af80ada13e5e34a26a28e3081dd0e (patch)
treeb2f51ccc66dbd4d728a7da3b91b44375fe455f00 /drivers
parent0d2b1cdfa11fd62d3358eef332e78b95b6a3e9ec (diff)
cpufreq: introduce cpufreq_driver_is_slow
Some architectures and platforms perform CPU frequency transitions through a non-blocking method, while some might block or sleep. Even when frequency transitions do not block or sleep they may be very slow. This distinction is important when trying to change frequency from a non-interruptible context in a scheduler hot path. Describe this distinction with a cpufreq driver flag, CPUFREQ_DRIVER_FAST. The default is to not have this flag set, thus erring on the side of caution. cpufreq_driver_is_slow() is also introduced in this patch. Setting the above flag will allow this function to return false. [smuckle@linaro.org: change flag/API to include drivers that are too slow for scheduler hot paths, in addition to those that block/sleep] Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Michael Turquette <mturquette@baylibre.com> Signed-off-by: Steve Muckle <smuckle@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 96f1a8860819..5ca8e9517aae 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -154,6 +154,12 @@ bool have_governor_per_policy(void)
}
EXPORT_SYMBOL_GPL(have_governor_per_policy);
+bool cpufreq_driver_is_slow(void)
+{
+ return !(cpufreq_driver->flags & CPUFREQ_DRIVER_FAST);
+}
+EXPORT_SYMBOL_GPL(cpufreq_driver_is_slow);
+
struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy)
{
if (have_governor_per_policy())