From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Stratos Karafotis <stratosk@semaphore.gr>
Cc: linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Lifeng Zheng <zhenglifeng1@huawei.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com
Subject: Re: [PATCH V2 3/3] cpufreq: conservative: Simplify frequency limit handling
Date: Fri, 22 May 2026 13:40:21 +0800 [thread overview]
Message-ID: <73d4fac8-9b49-4872-807f-8a69219aee7a@oss.qualcomm.com> (raw)
In-Reply-To: <292e6d937890f135e30ec0d2107eaad47cb9a976.1779423281.git.viresh.kumar@linaro.org>
On 5/22/2026 12:19 PM, Viresh Kumar wrote:
> From: Lifeng Zheng <zhenglifeng1@huawei.com>
>
> cs_dbs_update() performs explicit checks against policy->min/max
> before updating the target frequency. These checks are redundant as
> __cpufreq_driver_target() already clamps the requested frequency to
> the valid policy limits.
>
> Remove the unnecessary boundary checks and simplify the update logic.
>
> This also fixes an issue introduced by commit 00bfe05889e9 ("cpufreq:
> conservative: Decrease frequency faster for deferred updates"), where
> stale target comparisons could cause frequency updates to be skipped
> entirely after deferred adjustments.
>
> Closes: https://lore.kernel.org/all/20260421123545.1745998-1-zhenglifeng1@huawei.com/
> Fixes: 00bfe05889e9 ("cpufreq: conservative: Decrease frequency faster for deferred updates")
> Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
> Co-developed-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Thanks Viresh and Lifeng, this looks good to me.
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
> ---
> drivers/cpufreq/cpufreq_conservative.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
> index df01d33993d8..0b32ae28ec85 100644
> --- a/drivers/cpufreq/cpufreq_conservative.c
> +++ b/drivers/cpufreq/cpufreq_conservative.c
> @@ -103,10 +103,6 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
> if (load > dbs_data->up_threshold) {
> dbs_info->down_skip = 0;
>
> - /* if we are already at full speed then break out early */
> - if (requested_freq == policy->max)
> - goto out;
> -
> requested_freq += freq_step;
> if (requested_freq > policy->max)
> requested_freq = policy->max;
> @@ -124,13 +120,7 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
>
> /* Check for frequency decrease */
> if (load < cs_tuners->down_threshold) {
> - /*
> - * if we cannot reduce the frequency anymore, break out early
> - */
> - if (requested_freq == policy->min)
> - goto out;
> -
> - if (requested_freq > freq_step)
> + if (requested_freq > policy->min + freq_step)
> requested_freq -= freq_step;
> else
> requested_freq = policy->min;
--
Thx and BRs,
Zhongqiu Han
next prev parent reply other threads:[~2026-05-22 5:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 4:19 [PATCH V2 0/3] cpufreq: Simplify freq " Viresh Kumar
2026-05-22 4:19 ` [PATCH V2 1/3] cpufreq: Fix typo in comment Viresh Kumar
2026-05-22 4:19 ` [PATCH V3 2/3] cpufreq: Avoid redundant target() calls for unchanged limits Viresh Kumar
2026-05-22 5:39 ` Zhongqiu Han
2026-05-22 4:19 ` [PATCH V2 3/3] cpufreq: conservative: Simplify frequency limit handling Viresh Kumar
2026-05-22 5:40 ` Zhongqiu Han [this message]
2026-05-22 16:43 ` [PATCH V2 0/3] cpufreq: Simplify freq " Rafael J. Wysocki
2026-05-25 15:49 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2026-05-21 11:39 [PATCH 1/3] cpufreq: Fix typo in comment Viresh Kumar
2026-05-21 11:39 ` [PATCH V2 3/3] cpufreq: conservative: Simplify frequency limit handling Viresh Kumar
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=73d4fac8-9b49-4872-807f-8a69219aee7a@oss.qualcomm.com \
--to=zhongqiu.han@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=stratosk@semaphore.gr \
--cc=sumit.semwal@linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=zhenglifeng1@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
Powered by JetHome