From: Mario Limonciello <mario.limonciello@amd.com>
To: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>, gautham.shenoy@amd.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq/amd-pstate: Move max_perf limiting in amd_pstate_update
Date: Tue, 15 Apr 2025 15:46:30 -0500 [thread overview]
Message-ID: <e08fab15-3dce-4471-a016-abd6baab9340@amd.com> (raw)
In-Reply-To: <20250415082308.3341-1-dhananjay.ugwekar@amd.com>
On 4/15/2025 3:23 AM, Dhananjay Ugwekar wrote:
> Move up the max_perf limiting, so that we clamp the des_perf with the
> updated max_perf.
>
> Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/cpufreq/amd-pstate.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index c54c031939c8..c29840ba3b30 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -554,6 +554,10 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
> if (!policy)
> return;
>
> + /* limit the max perf when core performance boost feature is disabled */
> + if (!cpudata->boost_supported)
> + max_perf = min_t(u8, perf.nominal_perf, max_perf);
> +
> des_perf = clamp_t(u8, des_perf, min_perf, max_perf);
>
> policy->cur = perf_to_freq(perf, cpudata->nominal_freq, des_perf);
> @@ -563,10 +567,6 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
> des_perf = 0;
> }
>
> - /* limit the max perf when core performance boost feature is disabled */
> - if (!cpudata->boost_supported)
> - max_perf = min_t(u8, perf.nominal_perf, max_perf);
> -
> if (trace_amd_pstate_perf_enabled() && amd_pstate_sample(cpudata)) {
> trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq,
> cpudata->cur.mperf, cpudata->cur.aperf, cpudata->cur.tsc,
prev parent reply other threads:[~2025-04-15 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 8:23 [PATCH] cpufreq/amd-pstate: Move max_perf limiting in amd_pstate_update Dhananjay Ugwekar
2025-04-15 20:46 ` Mario Limonciello [this message]
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=e08fab15-3dce-4471-a016-abd6baab9340@amd.com \
--to=mario.limonciello@amd.com \
--cc=dhananjay.ugwekar@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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