Re: [PATCH v4] cpufreq: Keep global boost enabled after partial enable

From: Jiangtian Feng

Date: Mon Nov 30 2026 - 06:13:55 EST


Hi Pengjie,

On Mon, 30 Nov 2026, Pengjie Zhang wrote:
> I agree with treating global boost as permission. When global boost
> is 0, boost must be disabled for every active policy. When it is 1,
> each boost-capable policy can have boost enabled or disabled
> individually. Policies without boost support remain disabled.

Thank you for the review. This is also the model used by the partial-enable
change.

> Under that model, global boost can be 1 even when no active policy
> supports boost. Since 77cf053b041f, writing either 0 or 1 to the
> global knob returns -EINVAL in that case. This can happen on CPPC
> systems with no boost-capable policy, or when all boost-capable
> policies are offline.

There are two related cases that I would like to keep distinct. A
boost-capable policy may merely be inactive/offline, but there may also be
no policy supporting boost at all.

The function currently returns -EOPNOTSUPP for the latter, and
store_boost() maps any nonzero result to -EINVAL for the sysfs write. Your
description therefore matches the user-visible result.

> Initializing ret to 0 in cpufreq_boost_trigger_state() would let
> the core record the requested global setting and return success
> for either write in this case. Errors from policy_set_boost()
> would go through the failure handling in your patch.

I agree that a write should not fail merely because a boost-capable policy
is temporarily offline. Viresh also called out this distinction in the
original discussion:

https://lore.kernel.org/all/wnnfdvp3r3bg5wztazoijei2uji5xypl4b4wlvlxuwxaizu6g7@2xxyrk7kdxhf/

The later discussion accepted that the no-support case should still return
an error, using -EOPNOTSUPP:

https://lore.kernel.org/all/vzxdjhhkukb62kifaliwld3hhfrq2auhxt23bbz5r4vzebs3c7@2gjhlykrxfdd/

77cf053b041f introduced that error intentionally. Initializing ret to 0
unconditionally would remove this no-support behavior as well.

I will prepare a separate preparatory change that records whether any
policy supports boost, while still applying policy_set_boost() only to
active policies. The intent is to allow the global setting when a capable
policy is inactive, preserve the no-support error otherwise, and leave real
policy_set_boost() failures unchanged. The policy-list locking and lifetime
rules need to be covered in the review.

That keeps the partial-enable patch focused and preserves the distinction
from 77cf053b041f. I will include the offline and no-support cases in the
validation matrix.

Best regards,
Jiangtian