mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sumit Gupta <sumitg@nvidia.com>
To: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
	Christian Loehle <christian.loehle@arm.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhanjie9@hisilicon.com, superm1@kernel.org,
	zhangpengjie2@huawei.com
Subject: Re: [PATCH v2 2/2] cpufreq: Serialize global boost updates
Date: Thu, 5 Nov 2026 21:47:44 +0530	[thread overview]
Message-ID: <d9b2bb45-5997-4a5a-88c8-d99f56f0e969@nvidia.com> (raw)
In-Reply-To: <4606b154-e372-4d41-95ce-57b17f0f1d4a@oss.qualcomm.com>



On 05/11/26 20:31, Zhongqiu Han wrote:
> External email: Use caution opening links or attachments
> 
> 
> On 11/5/2026 10:41 PM, Sumit Gupta wrote:
>>
>>
>> On 05/11/26 14:33, Christian Loehle wrote:
>>> External email: Use caution opening links or attachments
>>>
>>>
>>> Serialize concurrent global boost sysfs writes with a mutex.
>>>
>>> Fixes: 6f19efc0a1ca ("cpufreq: Add boost frequency support in core")
>>> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
>>> Reviewed-by: Pengjie Zhang <zhangpengjie2@huawei.com>
>>> ---
>>>   drivers/cpufreq/cpufreq.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>>> index 23a77f5524df..d95c849f79c5 100644
>>> --- a/drivers/cpufreq/cpufreq.c
>>> +++ b/drivers/cpufreq/cpufreq.c
>>> @@ -2810,6 +2810,8 @@ int cpufreq_boost_set_sw(struct cpufreq_policy
>>> *policy, int state)
>>>   }
>>>   EXPORT_SYMBOL_GPL(cpufreq_boost_set_sw);
>>>
>>> +static DEFINE_MUTEX(cpufreq_boost_mutex);
>>> +
>>>   static int cpufreq_boost_trigger_state(int state)
>>>   {
>>>          struct cpufreq_policy *policy;
>>> @@ -2817,6 +2819,8 @@ static int cpufreq_boost_trigger_state(int state)
>>>          bool boost_enabled;
>>>          int ret = -EOPNOTSUPP;
>>>
>>> +       guard(mutex)(&cpufreq_boost_mutex);
>>> +
>>
>>
>> The policy->rwsem case from [1] seems to be still open. The per-policy
>> boost attribute calls policy_set_boost() with policy->rwsem held, but
>> cpufreq_boost_trigger_state() and cpufreq_online() don't, so they can
>> race with per-policy writers like ospm_nominal_freq in [1].
>>
>> Could cpufreq_boost_trigger_state() take the policy lock, as
>> cpufreq_suspend() does?
>>
>>    scoped_guard(cpufreq_policy_write, policy)
>>        ret = policy_set_boost(policy, state);
>>
>> [1] https://lore.kernel.org/lkml/20261030172745.2045743-4-
>> sumitg@nvidia.com/
>>
> 
> Hi Sumit,
> 
> Could you please check whether the following patch addresses the issue
> you mentioned?
> 
> https://lore.kernel.org/all/be3739f8-e668-4711-912c-91459d77ed35@arm.com/
> 
> 
Yes, that covers it. I missed that. Please ignore my comment.

Reviewed-by: Sumit Gupta <sumitg@nvidia.com>

Thanks,
Sumit


  reply	other threads:[~2026-11-05 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  9:03 [PATCH v2 0/2] cpufreq: Fix global boost state updates Christian Loehle
2026-11-05  9:03 ` [PATCH v2 1/2] cpufreq: Preserve global boost state on failed updates Christian Loehle
2026-11-05 12:38   ` Zhongqiu Han
2026-11-05 14:36   ` Sumit Gupta
2026-11-05  9:03 ` [PATCH v2 2/2] cpufreq: Serialize global boost updates Christian Loehle
2026-11-05 14:41   ` Sumit Gupta
2026-11-05 15:01     ` Zhongqiu Han
2026-11-05 16:17       ` Sumit Gupta [this message]
2026-11-05 15:01   ` Zhongqiu Han
2026-11-05 18:49     ` Rafael J. Wysocki (Intel)

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=d9b2bb45-5997-4a5a-88c8-d99f56f0e969@nvidia.com \
    --to=sumitg@nvidia.com \
    --cc=christian.loehle@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=superm1@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zhangpengjie2@huawei.com \
    --cc=zhanjie9@hisilicon.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®