Re: [PATCH 2/2] cpufreq: Keep global boost enabled after partial enable
From: Jiangtian Feng
Date: Thu Dec 03 2026 - 22:17:43 EST
Hi Viresh,
On Thu, 3 Dec 2026, Viresh Kumar wrote:
> I would rather name this differently.
>
> bool restore = !state;
`restore` reads better here. I think the initial/update rules need a
small adjustment to preserve v6 behavior in two failure cases:
> restore = false;
If state=1 and the first policy_set_boost() call fails, restore is false
from initialization, so the old global value is not restored. If state=0
and a successful call is followed by a failure, this assignment also
skips the restore. v6 intentionally restores the old global value in
both cases.
I have therefore used the following form in v7:
bool restore = true;
/* after each successful policy_set_boost() */
if (state)
restore = false;
/* on failure */
if (restore) {
/* restore the old global value */
}
Only a successful enable cancels the restore. A failed enable with no
successful policy updates, and every failed disable, restore the old
global value. The error return and the successful per-policy updates are
unchanged, so this is only the requested boolean cleanup with no
functional change from v6.
Thanks,
Jiangtian