Re: [PATCH 0/2] cpufreq: governor: Apply limits with target_freq instead of policy->cur

From: Viresh Kumar

Date: Fri Mar 13 2026 - 02:08:36 EST


On 13-03-26, 11:51, zhenglifeng (A) wrote:
> When querying cpuinfo_cur_freq, based on the following call chain, the
> target frequency will eventually be updated if policy->cur is out of
> limits:
>
> show_cpuinfo_cur_freq()
> __cpufreq_get()
> cpufreq_verify_current_freq()
> handle_update()
> refresh_frequency_limits()
> cpufreq_set_policy()
> cpufreq_governor_limits()
> cpufreq_dbs_governor_limits()
> cpufreq_policy_apply_limits()
> __cpufreq_driver_target()
>
> At least to me, it's strange that querying frequency would cause the
> target frequency to be updated.

Yeah, that is an optimization and not a feature. Normally checking the frequency
shouldn't lead to anything, but cpufreq core needs to fix itself and it actually
thinks that this won't happen. The hardware (yours) doing something secretly
isn't right and breaks the design to be honest. One way to fix all this mess is
to make your platform not do this and instead play with policy->min/max like
everyone else, instead of making a hard change secretly.

--
viresh