]> www.infradead.org Git - users/dwmw2/linux.git/commit
cpufreq: Introduce a more generic way to set default per-policy boost flag
authorLifeng Zheng <zhenglifeng1@huawei.com>
Fri, 17 Jan 2025 10:14:55 +0000 (18:14 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 23 Jan 2025 20:05:54 +0000 (21:05 +0100)
commitdd016f379ebc2d43a9405742d1a6066577509bd7
treed66cdbcae05b258f72eab8defaa19b215dc19f2f
parent1608f0230510489d74a2e24e47054233b7e4678a
cpufreq: Introduce a more generic way to set default per-policy boost flag

In cpufreq_online() of cpufreq.c, the per-policy boost flag is already
set to mirror the cpufreq_driver boost during init but using freq_table
to judge if the policy has boost frequency. There are two drawbacks to
this approach:

 1. It doesn't work for the cpufreq drivers that do not use a frequency
    table. For now, acpi-cpufreq and amd-pstate have to enable boost in
    policy initialization. And cppc_cpufreq never set policy to boost
    when going online no matter what the cpufreq_driver boost flag is.

 2. If the CPU goes offline when cpufreq_driver boost is enabled and
    then goes online when cpufreq_driver boost is disabled, the
    per-policy boost flag will incorrectly remain true.

Running set_boost at the end of the online process is a more generic way
for all cpufreq drivers.

Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Link: https://patch.msgid.link/20250117101457.1530653-3-zhenglifeng1@huawei.com
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c