From: Mario Limonciello <mario.limonciello@amd.com>
To: Juan Martinez <juan.martinez@amd.com>, gautham.shenoy@amd.com
Cc: rafael@kernel.org, viresh.kumar@linaro.org, perry.yuan@amd.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Kaushik Reddy S <kaushik.reddys@amd.com>,
Huang Rui <ray.huang@amd.com>
Subject: Re: [PATCH] cpufreq/amd-pstate: Fix MinPerf MSR value for performance policy
Date: Wed, 7 Jan 2026 15:24:31 -0600 [thread overview]
Message-ID: <25a4653c-4d95-44c7-a957-c3ac9da214ad@amd.com> (raw)
In-Reply-To: <20260107211919.38010-1-juan.martinez@amd.com>
On 1/7/26 3:19 PM, Juan Martinez wrote:
> When the CPU frequency policy is set to CPUFREQ_POLICY_PERFORMANCE
> (which occurs when EPP hint is set to "performance"), the driver
> incorrectly sets the MinPerf field in CPPC request MSR to nominal_perf
> instead of lowest_nonlinear_perf.
>
> According to the AMD architectural programmer's manual volume 2 [1],
> in section "17.6.4.1 CPPC_CAPABILITY_1", lowest_nonlinear_perf represents
> the most energy efficient performance level (in terms of performance per
> watt). The MinPerf field should be set to this value even in performance
> mode to maintain proper power/performance characteristics.
>
> This fixes a regression introduced by commit 0c411b39e4f4c ("amd-pstate: Set
> min_perf to nominal_perf for active mode performance gov"), which correctly
> identified that highest_perf was too high but chose nominal_perf as an
> intermediate value instead of lowest_nonlinear_perf.
>
> The fix changes amd_pstate_update_min_max_limit() to use lowest_nonlinear_perf
> instead of nominal_perf when the policy is CPUFREQ_POLICY_PERFORMANCE.
>
> [1] https://docs.amd.com/v/u/en-US/24593_3.43
> AMD64 Architecture Programmer's Manual Volume 2: System Programming
> Section 17.6.4.1 CPPC_CAPABILITY_1
> (Referenced in commit 5d9a354cf839a)
>
> Fixes: 0c411b39e4f4c ("amd-pstate: Set min_perf to nominal_perf for active mode performance gov")
> Tested-by: Kaushik Reddy S <kaushik.reddys@amd.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Juan Martinez <juan.martinez@amd.com>
I think this change is reasonable, but I'd like to get Gautham's
comments as the original author of 0c411b39e4f4c.
> ---
> drivers/cpufreq/amd-pstate.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index e4f1933dd7d47..de0bb5b325502 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -634,8 +634,8 @@ static void amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
> WRITE_ONCE(cpudata->max_limit_freq, policy->max);
>
> if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
> - perf.min_limit_perf = min(perf.nominal_perf, perf.max_limit_perf);
> - WRITE_ONCE(cpudata->min_limit_freq, min(cpudata->nominal_freq, cpudata->max_limit_freq));
> + perf.min_limit_perf = min(perf.lowest_nonlinear_perf, perf.max_limit_perf);
> + WRITE_ONCE(cpudata->min_limit_freq, min(cpudata->lowest_nonlinear_freq, cpudata->max_limit_freq));
> } else {
> perf.min_limit_perf = freq_to_perf(perf, cpudata->nominal_freq, policy->min);
> WRITE_ONCE(cpudata->min_limit_freq, policy->min);
next prev parent reply other threads:[~2026-01-07 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 21:19 Juan Martinez
2026-01-07 21:24 ` Mario Limonciello [this message]
2026-01-16 6:13 ` Gautham R. Shenoy
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=25a4653c-4d95-44c7-a957-c3ac9da214ad@amd.com \
--to=mario.limonciello@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=juan.martinez@amd.com \
--cc=kaushik.reddys@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=perry.yuan@amd.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=stable@vger.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®