mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
To: viresh.kumar@linaro.org
Cc: rafael@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com,
	christian.loehle@arm.com, ananthu.cv@oss.qualcomm.com,
	pierre.gondois@arm.com, zhangpengjie2@huawei.com,
	zhenglifeng1@huawei.com, zhanjie9@hisilicon.com,
	Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
Subject: Re: [PATCH 2/2] cpufreq: Keep global boost enabled after partial enable
Date: Fri,  4 Dec 2026 11:17:09 +0800	[thread overview]
Message-ID: <20261204031709.277138-1-jiangtianfeng@linux.alibaba.com> (raw)
In-Reply-To: <axFKMdliDVkbXG6b@vireshk-B250M-D3H>

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

  reply	other threads:[~2026-12-04  3:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  2:29 [PATCH v6 0/2] " Jiangtian Feng
2026-12-01  2:30 ` [PATCH 1/2] cpufreq: Allow global boost updates without active capable policies Jiangtian Feng
2026-12-02 16:34   ` Christian Loehle
2026-12-03 10:13   ` Zhongqiu Han
2026-12-03 10:40   ` Viresh Kumar
2026-12-03 10:57   ` Pengjie Zhang
2026-12-01  2:30 ` [PATCH 2/2] cpufreq: Keep global boost enabled after partial enable Jiangtian Feng
2026-12-02 16:35   ` Christian Loehle
2026-12-03 10:53   ` Viresh Kumar
2026-12-04  3:17     ` Jiangtian Feng [this message]
2026-12-03 10:13 ` [PATCH v6 0/2] " Zhongqiu Han
  -- strict thread matches above, loose matches on Subject: below --
2026-11-30 11:13 [PATCH v5 " Jiangtian Feng
2026-11-30 11:13 ` [PATCH 2/2] " Jiangtian Feng
2026-11-30 13:51   ` Pengjie Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204031709.277138-1-jiangtianfeng@linux.alibaba.com \
    --to=jiangtianfeng@linux.alibaba.com \
    --cc=ananthu.cv@oss.qualcomm.com \
    --cc=christian.loehle@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zhangpengjie2@huawei.com \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    --cc=zhongqiu.han@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®