mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pengjie Zhang <zhangpengjie2@huawei.com>
To: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>,
	<rafael@kernel.org>, <viresh.kumar@linaro.org>
Cc: <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>,
	<zhenglifeng1@huawei.com>, <zhanjie9@hisilicon.com>
Subject: Re: [PATCH 1/2] cpufreq: Allow global boost updates without active capable policies
Date: Thu, 3 Dec 2026 18:57:30 +0800	[thread overview]
Message-ID: <90326d8d-0f9c-4700-a925-02e907b0e6c0@huawei.com> (raw)
In-Reply-To: <20261201023001.1131130-2-jiangtianfeng@linux.alibaba.com>


On 12/1/2026 10:30 AM, Jiangtian Feng wrote:
> Global boost grants permission to use boost; it does not require boost to
> be active on every policy. Saving that permission should not depend on at
> least one boost-capable policy being active when the global knob is
> written.
>
> Since commit 77cf053b041f ("cpufreq: Return -EOPNOTSUPP if no policy
> supports boost"), cpufreq_boost_trigger_state() returns -EOPNOTSUPP when
> the active-policy loop has no boost-capable policy, and store_boost() maps
> that error to -EINVAL for the global sysfs write. Besides rejecting an
> otherwise valid preconfiguration, this prevents users from disabling boost
> before a capable policy becomes active when a driver starts with boost
> enabled by default.
>
> Initialize ret to 0 so the no-active-capable-policy case saves the
> requested global state and returns success. Continue to call
> policy_set_boost() for every active, boost-capable policy and preserve
> all real callback failures. This intentionally changes the no-policy
> result introduced by 77cf053b041f.
>
> Link: https://lore.kernel.org/all/467b9ef5-1fc3-4771-9895-363e815670c7@huawei.com/
>
> Qoder, an AI coding assistant, helped analyze the default-enabled case,
> review the active-policy/error semantics and draft this change and
> description. Runtime hardware and hotplug behavior remain subject to
> final review and validation.
>
> Signed-off-by: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
> ---
>   drivers/cpufreq/cpufreq.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 4332cb114070..e97838e40a54 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2887,7 +2887,7 @@ static int cpufreq_boost_trigger_state(int state)
>   	struct cpufreq_policy *policy;
>   	unsigned long flags;
>   	bool boost_enabled;
> -	int ret = -EOPNOTSUPP;
> +	int ret = 0;
>   
>   	guard(mutex)(&cpufreq_boost_mutex);
>   

Reviewed-by: Pengjie Zhang<zhangpengjie2@huawei.com>

  parent reply	other threads:[~2026-12-03 10:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  2:29 [PATCH v6 0/2] cpufreq: Keep global boost enabled after partial enable 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 [this message]
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-03 10:13 ` [PATCH v6 0/2] " Zhongqiu Han

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=90326d8d-0f9c-4700-a925-02e907b0e6c0@huawei.com \
    --to=zhangpengjie2@huawei.com \
    --cc=ananthu.cv@oss.qualcomm.com \
    --cc=christian.loehle@arm.com \
    --cc=jiangtianfeng@linux.alibaba.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=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®