cpufreq: Support for fast frequency switching
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Mar 2016 01:47:49 +0000 (03:47 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Apr 2016 23:09:03 +0000 (01:09 +0200)
commitb7898fda5bc7e786e76ce24fbd2ec993b08ec518
tree2bf721763c79a7fe0eca25349a549c52ba6ce483
parent379480d8258056bfdbaa65e4d3f024bb5b34b52b
cpufreq: Support for fast frequency switching

Modify the ACPI cpufreq driver to provide a method for switching
CPU frequencies from interrupt context and update the cpufreq core
to support that method if available.

Introduce a new cpufreq driver callback, ->fast_switch, to be
invoked for frequency switching from interrupt context by (future)
governors supporting that feature via (new) helper function
cpufreq_driver_fast_switch().

Add two new policy flags, fast_switch_possible, to be set by the
cpufreq driver if fast frequency switching can be used for the
given policy and fast_switch_enabled, to be set by the governor
if it is going to use fast frequency switching for the given
policy.  Also add a helper for setting the latter.

Since fast frequency switching is inherently incompatible with
cpufreq transition notifiers, make it possible to set the
fast_switch_enabled only if there are no transition notifiers
already registered and make the registration of new transition
notifiers fail if fast_switch_enabled is set for at least one
policy.

Implement the ->fast_switch callback in the ACPI cpufreq driver
and make it set fast_switch_possible during policy initialization
as appropriate.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h