mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
To: zhangpengjie2@huawei.com
Cc: ananthu.cv@oss.qualcomm.com, christian.loehle@arm.com,
	pierre.gondois@arm.com, rafael@kernel.org,
	viresh.kumar@linaro.org, zhongqiu.han@oss.qualcomm.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] cpufreq: Keep global boost enabled after partial enable
Date: Mon, 30 Nov 2026 19:13:27 +0800	[thread overview]
Message-ID: <20261130111327.363632-1-jiangtianfeng@linux.alibaba.com> (raw)
In-Reply-To: <744b868b-55af-4a12-86a8-f4fd5d132e6a@huawei.com>

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

      reply	other threads:[~2026-11-30 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 11:08 [RFC PATCH] " Jiangtian Feng
2026-11-26 15:07 ` Christian Loehle
2026-11-27  5:59   ` Jiangtian Feng
2026-11-26 15:09 ` Zhongqiu Han
2026-11-27  5:59   ` Jiangtian Feng
2026-11-27  1:49 ` [RFC PATCH v2] " Jiangtian Feng
2026-11-27  3:41   ` Zhongqiu Han
2026-11-27  5:59     ` Jiangtian Feng
2026-11-27  6:03   ` [RFC PATCH v3] " Jiangtian Feng
2026-11-27  6:54     ` Zhongqiu Han
2026-11-27  8:23       ` Jiangtian Feng
2026-11-27  9:05     ` [PATCH v4] " Jiangtian Feng
2026-11-30  8:12       ` Pengjie Zhang
2026-11-30 11:13         ` Jiangtian Feng [this message]

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=20261130111327.363632-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=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®