Re: [PATCH] cpufreq: Return -EINVAL if no policy is boost supported

From: Viresh Kumar

Date: Fri Nov 28 2025 - 01:07:01 EST


On 28-11-25, 12:02, zhenglifeng (A) wrote:
> On 2025/11/26 14:29, Viresh Kumar wrote:
> > On 26-11-25, 11:19, Lifeng Zheng wrote:
> >> In cpufreq_boost_trigger_state(), if all the policies are boost
> >> unsupported, policy_set_boost() will not be called and this function will
> >> return 0. But it is better to return an error to indicate that the platform
> >> doesn't support boost.
> >
> > I am not sure if it is a good idea. If boost isn't supported by any policy then
> > the driver shouldn't enable it at all.

Drivers like cpufreq-dt actually set the boost callback unconditionally, which
can lead to the case you mentioned. None of the policies support boost, but it
is configurable.

> Yes. So I think return an error is more reasonable when try to 'echo 1 >
> boost' in this situation.

I am inclining towards this now.

> > Also, cpufreq_table_validate_and_sort()
> > sets boost supported only if at least one policy supports it.
>
> Sorry, I don't see any connection to cpufreq_table_validate_and_sort().

Yeah, I misread, we are only configuring policy's boost flag there, not
driver's.

--
viresh