Skip to content

Commit 03d8b4e

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
cpufreq: CPPC: Fix wrong max_freq in policy initialization
In policy initialization, policy->max and policy->cpuinfo.max_freq are always set to the value calculated from caps->nominal_perf. This will cause the frequency stay on base frequency even if the policy is already boosted when a CPU is going online. Fix this by using policy->boost_enabled to determine which value should be set. Signed-off-by: Lifeng Zheng <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent dd016f3 commit 03d8b4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,15 +611,16 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
611611
* Section 8.4.7.1.1.5 of ACPI 6.1 spec)
612612
*/
613613
policy->min = cppc_perf_to_khz(caps, caps->lowest_nonlinear_perf);
614-
policy->max = cppc_perf_to_khz(caps, caps->nominal_perf);
614+
policy->max = cppc_perf_to_khz(caps, policy->boost_enabled ?
615+
caps->highest_perf : caps->nominal_perf);
615616

616617
/*
617618
* Set cpuinfo.min_freq to Lowest to make the full range of performance
618619
* available if userspace wants to use any perf between lowest & lowest
619620
* nonlinear perf
620621
*/
621622
policy->cpuinfo.min_freq = cppc_perf_to_khz(caps, caps->lowest_perf);
622-
policy->cpuinfo.max_freq = cppc_perf_to_khz(caps, caps->nominal_perf);
623+
policy->cpuinfo.max_freq = policy->max;
623624

624625
policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu);
625626
policy->shared_type = cpu_data->shared_type;

0 commit comments

Comments
 (0)