From: Riwen Lu <luriwen@hotmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rafael@kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, Riwen Lu <luriwen@kylinos.cn>
Subject: Re: [PATCH v2] cpufreq/cppc: Take policy->cur into judge when set target
Date: Thu, 30 May 2024 09:06:43 +0800 [thread overview]
Message-ID: <TYCP286MB2486B1D734F8E2D74BFBEEB1B1F32@TYCP286MB2486.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240529071244.vwognqagaa4347dm@vireshk-i7>
在 2024/5/29 15:12, Viresh Kumar 写道:
> On 29-05-24, 14:53, Riwen Lu wrote:
>> Yes, you are right, I didn't think it through. In this circumstance, the
>> policy->cur is the highest frequency, desired_perf converted from
>> target_freq is the same with cpu_data->perf_ctrls.desired_perf which
>> shouldn't.
>
> Please investigate more and see where the real problem is.
>
The boot CPU's frequency would be configured to the highest perf when
powered on from S3 even though the policy governor is powersave.
In cpufreq resume process, the booting CPU's new_freq obtained via
.get() is the highest frequency, while the policy->cur and
cpu->perf_ctrls.desired_perf are in the lowest level(powersave
governor). Causing the warning: "CPU frequency out of sync:", and set
policy->cur to new_freq. Then the governor->limits() calls
cppc_cpufreq_set_target() to configures the CPU frequency and returns
directly because the desired_perf converted from target_freq and
cpu->perf_ctrls.desired_perf are the same and both are the lowest_perf.
The problem is that the cpu->perf_ctrls.desired_perf is the lowest_perf
but it should be the highest_perf.
In my opinion, desired_perf and cpu->perf_ctrls.desired_perf represent
the target_freq and policy->cur respectively. Since target_freq and
policy->cur have been compared in __cpufreq_driver_target(), there's no
need to compare desired_perf and cpu->perf_ctrls.desired_perf again in
cppc_cpufreq_set_target().
So, maybe we can remove the following logic in cppc_cpufreq_set_target().
/* Return if it is exactly the same perf */
if (desired_perf == cpu_data->perf_ctrls.desired_perf)
return ret;
next prev parent reply other threads:[~2024-05-30 1:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 3:22 Riwen Lu
2024-05-29 5:36 ` Viresh Kumar
2024-05-29 6:53 ` Riwen Lu
2024-05-29 7:12 ` Viresh Kumar
2024-05-30 1:06 ` Riwen Lu [this message]
2024-05-30 5:56 ` Viresh Kumar
2024-05-30 6:02 ` Riwen Lu
2024-05-30 6:16 ` Viresh Kumar
2024-05-30 11:08 ` [PATCH v3] cpufreq/cppc: Remove the desired_perf compare " Riwen Lu
2024-06-06 9:07 ` Viresh Kumar
2024-06-11 8:54 ` Ionela Voinescu
2024-06-11 9:10 ` Viresh Kumar
2024-06-12 2:52 ` Riwen Lu
2024-06-12 6:24 ` Viresh Kumar
2024-06-12 6:26 ` Viresh Kumar
2024-06-14 12:12 ` Riwen Lu
2024-06-12 9:08 ` Pierre Gondois
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=TYCP286MB2486B1D734F8E2D74BFBEEB1B1F32@TYCP286MB2486.JPNP286.PROD.OUTLOOK.COM \
--to=luriwen@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=luriwen@kylinos.cn \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
/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®