Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 102fa9c

Browse files
superm1rafaeljw
authored andcommitted
cpufreq: Allow drivers to advertise boost enabled
The behavior introduced in commit f37a4d6 ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()") sets up the boost policy incorrectly when boost has been enabled by the platform firmware initially even if a driver sets the policy up. This is because policy_has_boost_freq() assumes that there is a frequency table set up by the driver and that the boost frequencies are advertised in that table. This assumption doesn't work for acpi-cpufreq or amd-pstate. Only use this check to enable boost if it's not already enabled instead of also disabling it if alreayd enabled. Fixes: f37a4d6 ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()") Link: https://patch.msgid.link/20240626204723.6237-1-mario.limonciello@amd.com Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> Suggested-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 22a40d1 commit 102fa9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,8 @@ static int cpufreq_online(unsigned int cpu)
14311431
}
14321432

14331433
/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */
1434-
policy->boost_enabled = cpufreq_boost_enabled() && policy_has_boost_freq(policy);
1434+
if (cpufreq_boost_enabled() && policy_has_boost_freq(policy))
1435+
policy->boost_enabled = true;
14351436

14361437
/*
14371438
* The initialization has succeeded and the policy is online.

0 commit comments

Comments
 (0)