public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Viktor Jägersküpper" <viktor_jaegerskuepper@freenet.de>,
	"Huang Rui" <ray.huang@amd.com>
Cc: linux-pm@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: [REGRESSION] CPU running at fixed frequency (~1.7 GHz) with kernel 7.1-rc1
Date: Wed, 29 Apr 2026 12:14:40 -0500	[thread overview]
Message-ID: <f4fd9018-2a05-454b-a887-9b1c9a8a14df@amd.com> (raw)
In-Reply-To: <dea2c864-bd47-4bc8-a46b-f061771c2b4d@freenet.de>

[-- Attachment #1: Type: text/plain, Size: 2674 bytes --]



On 4/29/26 11:20, Viktor Jägersküpper wrote:
> Am 29.04.26 um 17:54 schrieb Mario Limonciello:
>>
>>
>> On 4/29/26 10:38, Viktor Jägersküpper wrote:
>>> Am 29.04.26 um 16:25 schrieb Mario Limonciello:
>>>>
>>>>
>>>> On 4/29/26 08:54, Viktor Jägersküpper wrote:
>>>>> [You don't often get email from viktor_jaegerskuepper@freenet.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>>>>
>>>>> Am 29.04.26 um 15:04 schrieb Mario Limonciello:
>>>>>>
>>>>>>
>>>>>> On 4/29/26 07:34, Viktor Jägersküpper wrote:
>>>>>>> [You don't often get email from viktor_jaegerskuepper@freenet.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> when I boot my desktop system running with an AMD Ryzen 9 5900X using
>>>>>>> the kernel 7.1-rc1, all CPU cores seem to run at ~1.7 GHz constantly,
>>>>>>> i.e. I don't observe any core frequency boosting under load. This never
>>>>>>> happened with older kernel releases, e.g. with 7.0-rc7. I ran
>>>>>>> 'git bisect' and found this first bad commit:
>>>>>>>
>>>>>>> e30ca6dd5345c5b8ba05f346a8e81105352fe571 cpufreq/amd-pstate: Add dynamic energy performance preference
>>>>>>
>>>>>> If you compile with CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP=n (instead of using kernel command line to turn it off) does the issue go away?
>>>>>>
>>>>>
>>>>> No, and still nothing about amd-pstate in dmesg.
>>>>
>>>> Can you turn on dynamic debugging for amd-pstate.c?  Something like this:
>>>>
>>>> dyndbg='file drivers/cpufreq/amd-pstate.c +p'
>>>>
>>>
>>> Both kernel builds (with CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP=y/n) have the following config:
>>> CONFIG_DYNAMIC_DEBUG=y
>>> CONFIG_DYNAMIC_DEBUG_CORE=y
>>>
>>> Booting with the above dyndbg parameter gives me only this line about amd-pstate in dmesg:
>>> [    0.844066] amd_pstate: AMD CPPC shared memory based functionality is supported
>>>
>>> Do I have to do anything else besides booting with the dyndbg parameter? I have tried
>>> both builds.
>>
>> You shouldn't have to.  I think there might be something silently failing in the init path now.  Maybe platform profile registration is failing for your system?  I haven't reproduced this on my side on any of my systems unfortunately.
>>
>> Do you think you can sprinkle printk()'s around the init to figure it out?  If you need me to write a patch that does this I can try to whip one up.
>>
> 
> Please write a patch, I am just a user trying to help.

OK thanks.  Here is a debugging patch that should show what's happening 
in the new paths from e30ca6dd5345c5b8ba05f346a8e81105352fe571 so we can 
confirm root cause on your system.

[-- Attachment #2: 0001-debug-dynamic-epp.patch --]
[-- Type: text/x-patch, Size: 4251 bytes --]

From b812b2ccb29f6e05f6581bbc096a4c3321210816 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario.limonciello@amd.com>
Date: Wed, 29 Apr 2026 12:12:52 -0500
Subject: [PATCH] cpufreq/amd-pstate: Add debug logging for dynamic EPP paths

Add minimal debug logging for code paths introduced by commit e30ca6dd5345
(dynamic EPP) to diagnose CPU frequency stuck at base frequency issue.

Focus on:
- amd_pstate_get_balanced_epp() - power supply detection
- amd_pstate_set_dynamic_epp() - platform profile registration
- shmem_set_epp() - ACPI EPP write success/failure

NOT-FOR-MERGE: Debug instrumentation only
---
 drivers/cpufreq/amd-pstate.c | 42 +++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 9703b54ee4820..24ecc481064a4 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -433,12 +433,18 @@ static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)
 	if (epp == epp_cached)
 		return 0;
 
+	pr_info("amd_pstate: CPU %d: shmem_set_epp: setting EPP 0x%x (was 0x%x)\n",
+		cpudata->cpu, epp, epp_cached);
+
 	perf_ctrls.energy_perf = epp;
 	ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1);
 	if (ret) {
 		pr_debug("failed to set energy perf value (%d)\n", ret);
+		pr_err("amd_pstate: CPU %d: shmem_set_epp: cppc_set_epp_perf FAILED with error %d\n",
+		       cpudata->cpu, ret);
 		return ret;
 	}
+	pr_info("amd_pstate: CPU %d: shmem_set_epp: cppc_set_epp_perf succeeded\n", cpudata->cpu);
 
 	value = READ_ONCE(cpudata->cppc_req_cached);
 	value &= ~AMD_CPPC_EPP_PERF_MASK;
@@ -1169,8 +1175,15 @@ static void amd_pstate_cpu_exit(struct cpufreq_policy *policy)
 static int amd_pstate_get_balanced_epp(struct cpufreq_policy *policy)
 {
 	struct amd_cpudata *cpudata = policy->driver_data;
+	int power_status;
+	u8 epp;
+
+	power_status = power_supply_is_system_supplied();
+	epp = (power_status > 0) ? cpudata->epp_default_ac : cpudata->epp_default_dc;
+	pr_info("amd_pstate: CPU %d: get_balanced_epp: power_supply_is_system_supplied=%d, returning EPP=0x%x (ac=0x%x, dc=0x%x)\n",
+		policy->cpu, power_status, epp, cpudata->epp_default_ac, cpudata->epp_default_dc);
 
-	if (power_supply_is_system_supplied())
+	if (power_status > 0)
 		return cpudata->epp_default_ac;
 	else
 		return cpudata->epp_default_dc;
@@ -1306,15 +1319,22 @@ static int amd_pstate_set_dynamic_epp(struct cpufreq_policy *policy)
 						   &amd_pstate_profile_ops);
 	if (IS_ERR(cpudata->ppdev)) {
 		ret = PTR_ERR(cpudata->ppdev);
+		pr_err("amd_pstate: CPU %d: platform_profile_register FAILED: %d\n",
+		       policy->cpu, ret);
 		goto cleanup;
 	}
+	pr_info("amd_pstate: CPU %d: platform_profile_register succeeded\n", policy->cpu);
 
 	/* only enable notifier if things will actually change */
 	if (cpudata->epp_default_ac != cpudata->epp_default_dc) {
+		pr_info("amd_pstate: CPU %d: registering power supply notifier\n", policy->cpu);
 		cpudata->power_nb.notifier_call = amd_pstate_power_supply_notifier;
 		ret = power_supply_reg_notifier(&cpudata->power_nb);
-		if (ret)
+		if (ret) {
+			pr_err("amd_pstate: CPU %d: power_supply_reg_notifier FAILED: %d\n",
+			       policy->cpu, ret);
 			goto cleanup;
+		}
 	}
 
 	cpudata->dynamic_epp = true;
@@ -1947,10 +1967,22 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
 		cpudata->current_profile = PLATFORM_PROFILE_BALANCED;
 	}
 
-	if (dynamic_epp)
+	if (dynamic_epp) {
+		pr_info("amd_pstate: CPU %d: calling amd_pstate_set_dynamic_epp (current_profile=%d)\n",
+			policy->cpu, cpudata->current_profile);
 		ret = amd_pstate_set_dynamic_epp(policy);
-	else
-		ret = amd_pstate_set_epp(policy, amd_pstate_get_balanced_epp(policy));
+		if (ret)
+			pr_err("amd_pstate: CPU %d: amd_pstate_set_dynamic_epp FAILED: %d\n",
+			       policy->cpu, ret);
+	} else {
+		u8 epp = amd_pstate_get_balanced_epp(policy);
+		pr_info("amd_pstate: CPU %d: dynamic_epp=false, calling amd_pstate_set_epp with EPP=0x%x\n",
+			policy->cpu, epp);
+		ret = amd_pstate_set_epp(policy, epp);
+		if (ret)
+			pr_err("amd_pstate: CPU %d: amd_pstate_set_epp FAILED: %d\n",
+			       policy->cpu, ret);
+	}
 	if (ret)
 		goto free_cpudata1;
 
-- 
2.43.0


  reply	other threads:[~2026-04-29 17:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 12:34 [REGRESSION] CPU running at fixed frequency (~1.7 GHz) with kernel 7.1-rc1 Viktor Jägersküpper
2026-04-29 13:04 ` Mario Limonciello
2026-04-29 13:54   ` Viktor Jägersküpper
2026-04-29 14:25     ` Mario Limonciello
2026-04-29 15:38       ` Viktor Jägersküpper
2026-04-29 15:54         ` Mario Limonciello
2026-04-29 16:20           ` Viktor Jägersküpper
2026-04-29 17:14             ` Mario Limonciello [this message]
2026-04-29 18:34               ` Viktor Jägersküpper

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=f4fd9018-2a05-454b-a887-9b1c9a8a14df@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=ray.huang@amd.com \
    --cc=regressions@lists.linux.dev \
    --cc=viktor_jaegerskuepper@freenet.de \
    /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