]> 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)
commitf162e73496f25ca781e2405c84c6c0133e071609
tree8c931162140874a4d8549370207321e906d50f87
parent038392b2a53aad840124915d16e343af29721d0a
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