From: Christian Loehle <christian.loehle@arm.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>
Cc: "Gautham R . Shenoy" <gautham.shenoy@amd.com>,
Perry Yuan <perry.yuan@amd.com>, Huang Rui <ray.huang@amd.com>,
Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Christian Loehle <christian.loehle@arm.com>
Subject: [PATCH 1/2] cpufreq/amd-pstate: Keep minimum requests within policy limits
Date: Thu, 29 Oct 2026 12:19:44 +0000 [thread overview]
Message-ID: <20261029121945.854675-2-christian.loehle@arm.com> (raw)
In-Reply-To: <20261029121945.854675-1-christian.loehle@arm.com>
The minimum performance hint can exceed the policy maximum, e.g.
for schedutil when an RT task requests full CPU capacity. After
converting that hint, amd_pstate_adjust_perf() raises max_perf to
min_perf. This replaces the policy cap with the scheduler's minimum
request, and the subsequent Desired clamp uses the expanded interval.
Clamp min_perf to max_limit_perf instead of raising max_perf, to
enforce the policy's upper-bound again.
Fixes: 3f7b835fa4d0 ("cpufreq/amd-pstate: Move limit updating code")
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
drivers/cpufreq/amd-pstate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 4bedfbfc18b6..28df8507d93f 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -866,8 +866,7 @@ static void amd_pstate_adjust_perf(struct cpufreq_policy *policy,
min_perf = perf.min_limit_perf;
max_perf = perf.max_limit_perf;
- if (max_perf < min_perf)
- max_perf = min_perf;
+ min_perf = min(min_perf, max_perf);
amd_pstate_update(policy, min_perf, des_perf, max_perf, true,
policy->governor->flags);
--
2.34.1
next prev parent reply other threads:[~2026-10-29 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 12:19 [PATCH 0/2] cpufreq/amd-pstate register write fixes Christian Loehle
2026-10-29 12:19 ` Christian Loehle [this message]
2026-10-29 12:19 ` [PATCH 2/2] cpufreq/amd-pstate: Clamp desired perf on resume Christian Loehle
2026-10-29 19:35 ` [PATCH 0/2] cpufreq/amd-pstate register write fixes Mario Limonciello
2026-10-30 3:11 ` K Prateek Nayak
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=20261029121945.854675-2-christian.loehle@arm.com \
--to=christian.loehle@arm.com \
--cc=Dhananjay.Ugwekar@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--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®