From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: "Mario Limonciello (AMD)" <superm1@kernel.org>
Cc: Perry Yuan <perry.yuan@amd.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@vger.kernel.org>,
"open list:CPU FREQUENCY SCALING FRAMEWORK"
<linux-pm@vger.kernel.org>
Subject: Re: [PATCH] cpufreq/amd-pstate: Fix a regression leading to EPP 0 after hibernate
Date: Thu, 9 Oct 2025 09:41:49 +0530 [thread overview]
Message-ID: <aOc2BcT9NUCO8HJp@BLRRASHENOY1.amd.com> (raw)
In-Reply-To: <20250923152929.1306578-1-superm1@kernel.org>
On Tue, Sep 23, 2025 at 10:29:29AM -0500, Mario Limonciello (AMD) wrote:
> After resuming from S4, all CPUs except the boot CPU have the wrong EPP
> hint programmed. This is because when the CPUs were offlined the EPP value
> was reset to 0.
>
> This is a similar problem as fixed by
> commit ba3319e590571 ("cpufreq/amd-pstate: Fix a regression leading to EPP
> 0 after resume") and the solution is also similar. When offlining rather
> than reset the values to zero, reset them to match those chosen by the
> policy. When the CPUs are onlined again these values will be restored.
>
> Closes: https://community.frame.work/t/increased-power-usage-after-resuming-from-suspend-on-ryzen-7040-kernel-6-15-regression/74531/20?u=mario_limonciello
> Fixes: 608a76b65288 ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option")
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Apologies for the delay in reviewing this.
The fix looks good to me.
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
--
Thanks and Regards
gautham.
> ---
> drivers/cpufreq/amd-pstate.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 9f3b9dc26ab5..ba2adea03db1 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1617,7 +1617,11 @@ static int amd_pstate_cpu_offline(struct cpufreq_policy *policy)
> * min_perf value across kexec reboots. If this CPU is just onlined normally after this, the
> * limits, epp and desired perf will get reset to the cached values in cpudata struct
> */
> - return amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
> + return amd_pstate_update_perf(policy, perf.bios_min_perf,
> + FIELD_GET(AMD_CPPC_DES_PERF_MASK, cpudata->cppc_req_cached),
> + FIELD_GET(AMD_CPPC_MAX_PERF_MASK, cpudata->cppc_req_cached),
> + FIELD_GET(AMD_CPPC_EPP_PERF_MASK, cpudata->cppc_req_cached),
> + false);
> }
>
> static int amd_pstate_suspend(struct cpufreq_policy *policy)
> --
> 2.51.0
>
prev parent reply other threads:[~2025-10-09 4:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 15:29 Mario Limonciello (AMD)
2025-10-09 4:11 ` Gautham R. Shenoy [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=aOc2BcT9NUCO8HJp@BLRRASHENOY1.amd.com \
--to=gautham.shenoy@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=perry.yuan@amd.com \
--cc=superm1@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
all inboxes | Powered by JetHome®