linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: viresh.kumar@linaro.org, Souvik.Chakravarty@arm.com,
	Thanu.Rangarajan@arm.com, Sudeep.Holla@arm.com,
	guohanjun@huawei.com, john.garry@huawei.com,
	jonathan.cameron@huawei.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()'
Date: Thu, 14 May 2020 15:54:47 +0200	[thread overview]
Message-ID: <28914151.3vfbF0e6KZ@kreacher> (raw)
In-Reply-To: <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com>

On Friday, May 8, 2020 11:11:02 AM CEST Xiongfeng Wang wrote:
> When I try to add SW BOOST support for CPPC, I got the following error:
> cpufreq: cpufreq_boost_trigger_state: Cannot enable BOOST
> cpufreq: store_boost: Cannot enable BOOST!
> 
> It is because return value 1 of 'freq_qos_update_request()' means the
> effective constraint value has changed, not a error code on failures.
> But for 'cpufreq_driver.set_boost()', a nonzero return value means
> failure. So change 'ret' to zero when 'freq_qos_update_request()'
> returns a positive value.
> 
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> ---
>  drivers/cpufreq/cpufreq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 4adac3a..475fb1b 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2522,6 +2522,8 @@ static int cpufreq_boost_set_sw(int state)
>  		ret = freq_qos_update_request(policy->max_freq_req, policy->max);
>  		if (ret < 0)
>  			break;
> +		else
> +			ret = 0;
>  	}
>  
>  	return ret;
>

I would change cpufreq_boost_trigger_state() to take the 1 into account properly
instead.

Thanks!




  reply	other threads:[~2020-05-14 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  9:11 [RFC PATCH 0/3] add SW BOOST support for CPPC Xiongfeng Wang
2020-05-08  9:11 ` [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()' Xiongfeng Wang
2020-05-14 13:54   ` Rafael J. Wysocki [this message]
2020-05-15  1:28     ` Xiongfeng Wang
2020-05-08  9:11 ` [RFC PATCH 2/3] cpufreq: Add SW BOOST support for drivers without frequency table Xiongfeng Wang
2020-05-14 14:16   ` Rafael J. Wysocki
2020-05-15  1:49     ` Xiongfeng Wang
2020-05-18  7:53       ` Viresh Kumar
2020-05-19  1:04         ` Xiongfeng Wang
2020-05-08  9:11 ` [RFC PATCH 3/3] CPPC: add support for SW BOOST Xiongfeng Wang

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=28914151.3vfbF0e6KZ@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=Souvik.Chakravarty@arm.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=Thanu.Rangarajan@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=john.garry@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=wangxiongfeng2@huawei.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;
as well as URLs for NNTP newsgroup(s).