cpufreq: introduce cpufreq_driver_is_slow
authorMichael Turquette <mturquette@baylibre.com>
Tue, 30 Jun 2015 11:45:27 +0000 (12:45 +0100)
committerPunit Agrawal <punit.agrawal@arm.com>
Mon, 21 Mar 2016 12:42:03 +0000 (12:42 +0000)
commit41cd340c358f44bf50471dcb8ab1d79a276d3da5
tree51b8e4781ff91963eb71ad226c64c24121b505ce
parenta52dae6571b52b8daa54b6d9f7a3e12c54c0649d
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>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h