]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: schedutil: Always call driver if CPUFREQ_NEED_UPDATE_LIMITS is set
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Oct 2020 11:12:46 +0000 (12:12 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Oct 2020 13:12:18 +0000 (14:12 +0100)
commitd585f3eb452f62ac2157f4e83e7549525e1bd4f5
tree5e12e5b914ae12ac25f1566d37a1575925692d71
parent9e10d9aa5a4c5884bbb48c4c5b55583151a2775f
cpufreq: schedutil: Always call driver if CPUFREQ_NEED_UPDATE_LIMITS is set

Because sugov_update_next_freq() may skip a frequency update even if
the need_freq_update flag has been set for the policy at hand, policy
limits updates may not take effect as expected.

For example, if the intel_pstate driver operates in the passive mode
with HWP enabled, it needs to update the HWP min and max limits when
the policy min and max limits change, respectively, but that may not
happen if the target frequency does not change along with the limit
at hand.  In particular, if the policy min is changed first, causing
the target frequency to be adjusted to it, and the policy max limit
is changed later to the same value, the HWP max limit will not be
updated to follow it as expected, because the target frequency is
still equal to the policy min limit and it will not change until
that limit is updated.

To address this issue, modify get_next_freq() to let the driver
callback run if the CPUFREQ_NEED_UPDATE_LIMITS cpufreq driver flag
is set regardless of whether or not the new frequency to set is
equal to the previous one.

Fixes: e43b6ae4dc34 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled")
Reported-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Cc: 5.9+ <stable@vger.kernel.org> # 5.9+: f162e73496f2 cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS ...
Cc: 5.9+ <stable@vger.kernel.org> # 5.9+: 9e10d9aa5a4c cpufreq: Introduce cpufreq_driver_test_flags()
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/sched/cpufreq_schedutil.c