mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
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
Subject: Re: [PATCH 2/2] cpufreq: Keep global boost enabled after partial enable
Date: Thu, 3 Dec 2026 16:23:37 +0530	[thread overview]
Message-ID: <axFKMdliDVkbXG6b@vireshk-B250M-D3H> (raw)
In-Reply-To: <20261201023001.1131130-3-jiangtianfeng@linux.alibaba.com>

On 01-12-26, 10:30, Jiangtian Feng wrote:
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2887,6 +2887,7 @@ static int cpufreq_boost_trigger_state(int state)
>  	struct cpufreq_policy *policy;
>  	unsigned long flags;
>  	bool boost_enabled;
> +	bool policy_success = false;

I would rather name this differently.

bool restore = !state;

>  	int ret = 0;
>  
>  	guard(mutex)(&cpufreq_boost_mutex);
> @@ -2911,6 +2912,8 @@ static int cpufreq_boost_trigger_state(int state)
>  		ret = policy_set_boost(policy, state);
>  		if (unlikely(ret))
>  			break;
> +
> +		policy_success = true;

restore = false;

>  	}
>  
>  	cpus_read_unlock();
> @@ -2918,9 +2921,12 @@ static int cpufreq_boost_trigger_state(int state)
>  	if (likely(!ret))
>  		return 0;
>  
> -	write_lock_irqsave(&cpufreq_driver_lock, flags);
> -	cpufreq_driver->boost_enabled = boost_enabled;
> -	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> +	/* On failure, restore old state unless partial enable needs local repair. */
> +	if (!state || !policy_success) {

if (restore) {

> +		write_lock_irqsave(&cpufreq_driver_lock, flags);
> +		cpufreq_driver->boost_enabled = boost_enabled;
> +		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> +	}
>  
>  	pr_err("%s: Cannot %s BOOST\n",
>  	       __func__, str_enable_disable(state));

-- 
viresh

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

Thread overview: 12+ 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 [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=axFKMdliDVkbXG6b@vireshk-B250M-D3H \
    --to=viresh.kumar@linaro.org \
    --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=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®