Re: [PATCH v3 2/2] cpufreq: fix policy max not returning to non-boost freq on boost disable
From: Viresh Kumar
Date: Tue Nov 17 2026 - 05:34:48 EST
On 11-11-26, 18:10, Ananthu C V wrote:
> diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
> index ea994647abc8..5b364d8da4f9 100644
> --- a/drivers/cpufreq/freq_table.c
> +++ b/drivers/cpufreq/freq_table.c
> @@ -49,15 +49,16 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy)
> max_freq = freq;
> }
>
> - policy->cpuinfo.min_freq = min_freq;
> + policy->min = policy->cpuinfo.min_freq = min_freq;
> + policy->max = max_freq;
> /*
> * If the driver has set its own cpuinfo.max_freq above max_freq, leave
> * it as is.
> */
> if (policy->cpuinfo.max_freq < max_freq)
> - policy->cpuinfo.max_freq = max_freq;
> + policy->max = policy->cpuinfo.max_freq = max_freq;
>
> - if (min_freq == ~0)
> + if (policy->min == ~0)
> return -EINVAL;
> else
> return 0;
>
> I am pretty sure we can maintain the policy->min status quo and only touch the
> policy->max updation; which from a passing glance simply seems inconsequential.
> Potential side effects, if any, aside, this would at least fix the issue at
> hand, which is the frequency getting stuck on a higher value without being able
> to come down. What do you think about this?
So a change like this also fixes the issue ?
@@ -49,15 +49,16 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy)
max_freq = freq;
}
policy->cpuinfo.min_freq = min_freq;
+ policy->max = max_freq;
/*
* If the driver has set its own cpuinfo.max_freq above max_freq, leave
* it as is.
*/
if (policy->cpuinfo.max_freq < max_freq)
- policy->cpuinfo.max_freq = max_freq;
+ policy->max = policy->cpuinfo.max_freq = max_freq;
Also, can you please explain the issue again in detail. I am not very
sure how you are reaching to this issue over current mainline (without
the first patch).
--
viresh