]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS driver flag
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Oct 2020 15:35:19 +0000 (17:35 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 27 Oct 2020 17:47:40 +0000 (18:47 +0100)
commitaaa15025b0a11d1003fbea7a7cf10096ea16e166
tree8c931162140874a4d8549370207321e906d50f87
parent5515ca5b5b5af88d6b022bea0f31d1b05ec20c16
cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS driver flag

Generally, a cpufreq driver may need to update some internal upper
and lower frequency boundaries on policy max and min changes,
respectively, but currently this does not work if the target
frequency does not change along with the policy limit.

Namely, if the target frequency does not change along with the
policy min or max, the "target_freq == policy->cur" check in
__cpufreq_driver_target() prevents driver callbacks from being
invoked and they do not even have a chance to update the
corresponding internal boundary.

This particularly affects the "powersave" and "performance"
governors that always set the target frequency to one of the
policy limits and it never changes when the other limit is updated.

To allow cpufreq the drivers needing to update internal frequency
boundaries on policy limits changes to avoid this issue, introduce
a new driver flag, CPUFREQ_NEED_UPDATE_LIMITS, that (when set) will
neutralize the check mentioned above.

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