]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
commit1c534352f47fd83eb08075ac2474f707e74bf7f7
tree8c931162140874a4d8549370207321e906d50f87
parentdb865272d9c4687520dc29f77e701a1b2669872f
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