Bug 218705 - amd_pstate fails to load on AMD 5950x with Asus ROG CROSSHAIR VIII DARK HERO x570
Summary: amd_pstate fails to load on AMD 5950x with Asus ROG CROSSHAIR VIII DARK HERO ...
Status: NEW
Alias: None
Product: Power Management
Classification: Unclassified
Component: cpufreq (show other bugs)
Hardware: AMD Linux
: P3 normal
Assignee: linux-pm@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-10 16:52 UTC by Andrei Amuraritei
Modified: 2024-04-27 22:58 UTC (History)
3 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
cppc check script (919 bytes, application/x-shellscript)
2024-04-22 08:04 UTC, Perry Yuan(AMD)
Details
values from cppc_attr_values_check.sh script (6.12 KB, text/plain)
2024-04-22 11:07 UTC, Andrei Amuraritei
Details
cpufreq_grep (931 bytes, text/plain)
2024-04-25 15:25 UTC, Andrei Amuraritei
Details
dmesg with amd_pstate.dyndbg (118.05 KB, text/plain)
2024-04-25 15:26 UTC, Andrei Amuraritei
Details
lscpu -ae (2.32 KB, text/plain)
2024-04-25 15:26 UTC, Andrei Amuraritei
Details
cpufreq_grep with amd_pstate=active (630 bytes, text/plain)
2024-04-25 15:27 UTC, Andrei Amuraritei
Details
dmesg with amd_pstate.dyndbg and amd_pstate=active (133.77 KB, text/plain)
2024-04-25 15:27 UTC, Andrei Amuraritei
Details
lscpu -ae with amd_pstate=active (2.29 KB, text/plain)
2024-04-25 15:27 UTC, Andrei Amuraritei
Details
lscpu -ae with amd_pstate=passive (2.29 KB, text/plain)
2024-04-26 17:24 UTC, Andrei Amuraritei
Details
dmesg with amd_pstate.dyndbg and amd_pstate=passive (117.54 KB, text/plain)
2024-04-26 17:25 UTC, Andrei Amuraritei
Details
cpufreq_grep with amd_pstate=passive (529 bytes, text/plain)
2024-04-26 17:25 UTC, Andrei Amuraritei
Details

Description Andrei Amuraritei 2024-04-10 16:52:17 UTC
Hi!

Sorry if the formatting is broken or this is unreadable. Description preview is broken it seems.

amd_pstate fails to load on this hardware:
CPU: AMD 5950x
Mainboard: Asus ROG CROSSHAIR VIII DARK HERO x570 running UEFI version 4702
OS: Fedora 39 Wayland with kernel Linux 6.8.4-200.fc39.x86_64

amd_pstate does not get automatically enabled. dmesg -T | grep pstate says: 

[Tue Apr  9 17:24:36 2024] amd_pstate: driver load is disabled, boot with specific mode to enable this

No cppc found in output from lscpu. In UEFI the following are activated:

Advanced > AMD CBS > NBIO Common Options > SMU Common Options

CPPC (Auto / Enabled / Disabled): Enabled
CPPC Preferred Cores: Enabled
Comment 1 Andrei Amuraritei 2024-04-10 16:54:46 UTC
Reading though 218171, I have checked if my ACPI tables have the _CPC entries and they do:

ssdt10.dsl:        Name (_CPC, Package (0x17)  // _CPC: Continuous Performance Control
Comment 2 Brandon Nielsen 2024-04-15 16:04:39 UTC
Looking at the source[0] I think this is by design.

I am not sure what the current roadmap for enablement looks like, but I am also awaiting it.

[0] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/amd-pstate.c#n55
Comment 3 Perry Yuan(AMD) 2024-04-22 08:04:46 UTC
Created attachment 306192 [details]
cppc check script
Comment 4 Perry Yuan(AMD) 2024-04-22 08:06:31 UTC
(In reply to Andrei Amuraritei from comment #0)
> Hi!
> 
> Sorry if the formatting is broken or this is unreadable. Description preview
> is broken it seems.
> 
> amd_pstate fails to load on this hardware:
> CPU: AMD 5950x
> Mainboard: Asus ROG CROSSHAIR VIII DARK HERO x570 running UEFI version 4702
> OS: Fedora 39 Wayland with kernel Linux 6.8.4-200.fc39.x86_64
> 
> amd_pstate does not get automatically enabled. dmesg -T | grep pstate says: 
> 
> [Tue Apr  9 17:24:36 2024] amd_pstate: driver load is disabled, boot with
> specific mode to enable this
> 
> No cppc found in output from lscpu. In UEFI the following are activated:
> 
> Advanced > AMD CBS > NBIO Common Options > SMU Common Options
> 
> CPPC (Auto / Enabled / Disabled): Enabled
> CPPC Preferred Cores: Enabled

Hi Andrei
Could you use the script to check the CPPC capabilities?
As I know, the 5950x is in the CPPC supported list, I need more information to check what the system is missing.

Perry.
Comment 5 Andrei Amuraritei 2024-04-22 11:07:07 UTC
Created attachment 306195 [details]
values from cppc_attr_values_check.sh script

Hi Perry,

I've attached 20240422-cppc_check.txt with the output from the script.

pstate did not load automatically for me on this system as long as I remember (across Debian or Fedora with kernels 6.x).

Let me know what other info you require please.

Thanks,
Andrei Amuraritei
Comment 6 Perry Yuan(AMD) 2024-04-25 03:36:51 UTC
I have confirmed that the CPPC capabilities are valid to enable pstate driver,

1) sudo nano /etc/default/grub
2) add ``amd_pstate.dyndbg=+p`` to kernel command line.
3) sudo update-grub
4) sudo reboot

then share below logs to me.

# dmesg
# lscpu -ae
# cd /sys/devices/system/cpu/cpu0/cpufreq
# grep -R .

Perry.
Comment 7 Perry Yuan(AMD) 2024-04-25 03:36:52 UTC
I have confirmed that the CPPC capabilities are valid to enable pstate driver,

1) sudo nano /etc/default/grub
2) add ``amd_pstate.dyndbg=+p`` to kernel command line.
3) sudo update-grub
4) sudo reboot

then share below logs to me.

# dmesg
# lscpu -ae
# cd /sys/devices/system/cpu/cpu0/cpufreq
# grep -R .

Perry.
Comment 8 Perry Yuan(AMD) 2024-04-25 05:27:17 UTC
BTW, which kernel version you used?
Have you added "amd_pstate=active" to command line?
Comment 9 Andrei Amuraritei 2024-04-25 15:25:27 UTC
Created attachment 306207 [details]
cpufreq_grep
Comment 10 Andrei Amuraritei 2024-04-25 15:26:13 UTC
Created attachment 306208 [details]
dmesg with amd_pstate.dyndbg
Comment 11 Andrei Amuraritei 2024-04-25 15:26:37 UTC
Created attachment 306209 [details]
lscpu -ae
Comment 12 Andrei Amuraritei 2024-04-25 15:27:07 UTC
Created attachment 306210 [details]
cpufreq_grep with amd_pstate=active
Comment 13 Andrei Amuraritei 2024-04-25 15:27:36 UTC
Created attachment 306211 [details]
dmesg with amd_pstate.dyndbg and amd_pstate=active
Comment 14 Andrei Amuraritei 2024-04-25 15:27:54 UTC
Created attachment 306212 [details]
lscpu -ae with amd_pstate=active
Comment 15 Andrei Amuraritei 2024-04-25 15:33:16 UTC
Hi Perry,

Attached the required output of the commands specified. First files are after adding amd_pstate.dyndbg=+p but there amd_pstate still did not load automatically.

Then I also added amd_pstate=active to the kernel param list and attached the outputs from commands, with "active" in names.

Kernel when opened the bug was 6.8.4-200.fc39.x86_64 and right now it is 6.8.6-200.fc39.x86_64 as specified in dmesg output.

"Talk" soon.
Andrei Amuraritei
Comment 16 xiaojian.du 2024-04-25 17:51:54 UTC
From the dmesg log:
......
[Do Apr 25 17:18:53 2024] device-mapper: uevent: version 1.0.3
[Do Apr 25 17:18:53 2024] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[Do Apr 25 17:18:53 2024] amd_pstate: AMD CPPC **shared memory** based functionality is supported
[Do Apr 25 17:18:53 2024] amd_pstate: policy_max =5084000, policy_min=550000
[Do Apr 25 17:18:53 2024] amd_pstate: set_policy: cpuinfo.max 5084000 policy->max 5084000
[Do Apr 25 17:18:53 2024] amd_pstate: policy_max =5084000, policy_min=550000
[Do Apr 25 17:18:53 2024] amd_pstate: set_policy: cpuinfo.max 5084000 policy->max 5084000
[Do Apr 25 17:18:53 2024] amd_pstate: policy_max =5084000, policy_min=550000
[Do Apr 25 17:18:53 2024] amd_pstate: set_policy: cpuinfo.max 5084000 policy->max
......

R9-5950X is ZEN3 Arch CPU and has half support for CPPC.
Would you try to use "amd_pstate=passive" in the grub config?
Comment 17 Andrei Amuraritei 2024-04-26 17:24:52 UTC
Created attachment 306222 [details]
lscpu -ae with amd_pstate=passive
Comment 18 Andrei Amuraritei 2024-04-26 17:25:14 UTC
Created attachment 306223 [details]
dmesg with amd_pstate.dyndbg and amd_pstate=passive
Comment 19 Andrei Amuraritei 2024-04-26 17:25:35 UTC
Created attachment 306224 [details]
cpufreq_grep with amd_pstate=passive
Comment 20 Andrei Amuraritei 2024-04-26 17:27:22 UTC
Hi Xiaojian,

Booted with amd_passive and ran the commands. Output attached in files with passive in name.

Friendly greetings
Andrei Amuraritei
Comment 21 Andrei Amuraritei 2024-04-26 17:40:58 UTC
Not sure if relevant, but I found out that Fedora also has amd-pstate-ut module, and loading this, i see the following in dmesg:


boot kernel with amd_pstate=passive

[Fr Apr 26 19:37:29 2024] amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid	 success!
[Fr Apr 26 19:37:29 2024] amd_pstate_ut: 2    amd_pstate_ut_check_enabled	 success!
[Fr Apr 26 19:37:29 2024] amd_pstate_ut: amd_pstate_ut_check_perf cpu0 highest=221 166 nominal=111 111 lowest_nonlinear=57 57 lowest=19 19, they should be equal!
[Fr Apr 26 19:37:29 2024] amd_pstate_ut: 3    amd_pstate_ut_check_perf	 fail!
[Fr Apr 26 19:37:29 2024] amd_pstate_ut: 4    amd_pstate_ut_check_freq	 success!

boot kernel with amd_pstate=active

[Fr Apr 26 19:35:07 2024] amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid	 success!
[Fr Apr 26 19:35:07 2024] amd_pstate_ut: 2    amd_pstate_ut_check_enabled	 success!
[Fr Apr 26 19:35:07 2024] amd_pstate_ut: amd_pstate_ut_check_perf cpu0 highest=221 166 nominal=111 111 lowest_nonlinear=57 57 lowest=19 19, they should be equal!
[Fr Apr 26 19:35:07 2024] amd_pstate_ut: 3    amd_pstate_ut_check_perf	 fail!
[Fr Apr 26 19:35:07 2024] amd_pstate_ut: 4    amd_pstate_ut_check_freq	 success!
Comment 22 Perry Yuan(AMD) 2024-04-27 00:49:56 UTC
Hi Andrei,

I saw the pstate passive mode driver was loaded on your system, how do you check the pstate dricer loaded or not?

# sudo  cpupower frequency-info
you could use cpupower to see if the driver loaded gernerally. 


[Fr Apr 26 19:20:02 2024] amd_pstate: AMD CPPC shared memory based functionality is supported.


root@fedora:/sys/devices/system/cpu/cpu0/cpufreq# grep -R .
amd_pstate_highest_perf:166
scaling_min_freq:550000
scaling_available_governors:conservative ondemand userspace powersave performance schedutil 
scaling_governor:schedutil
cpuinfo_max_freq:5084000
boost:0
amd_pstate_lowest_nonlinear_freq:1743000
amd_pstate_max_freq:5084000
related_cpus:0
scaling_cur_freq:2880470
scaling_setspeed:<unsupported>
affected_cpus:0
scaling_max_freq:5084000
cpuinfo_transition_latency:20000
scaling_driver:amd-pstate<<<<<<<<<<<<<<<<<<<<<<<<<
cpuinfo_min_freq:550000

Perry.
Comment 23 Andrei Amuraritei 2024-04-27 06:38:47 UTC
Hi Perry,

The driver loads when manually specifying amd_pstate kernel param. My issue is that it does not get automatically enabled for the system, as stated in the first message.

The issue is why is not enabled automatically, if the hardware support is there?

Thanks.
Andrei Amuraritei
Comment 24 Perry Yuan(AMD) 2024-04-27 13:25:55 UTC
Hi Andrei,

"pstate did not load automatically for me on this system as long as I remember (across Debian or Fedora with kernels 6.x)."

Ok, I thought your system cannot load pstate driver, not the problem is simple to resolve.

Have you configured the kernel config to enable the default mode 3(EPP) or set to disabled?

Could you check your kernel config if you have enabled the AMD pstate driver?

Here is my kernel config option, you can update config if you have not enabled it to default 3. 

# grep -rsn  AMD_PSTATE .config
693:CONFIG_X86_AMD_PSTATE=y
694:CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
695:# CONFIG_X86_AMD_PSTATE_UT is not set

Perry.
Comment 25 Andrei Amuraritei 2024-04-27 22:58:55 UTC
Hi again,

I meant, amd_pstate did not load automatically, without me specifying a kernel param for it.

The .config values are (Fedora default config):

grep -rsn  AMD_PSTATE /boot/config-6.8.7-200.fc39.x86_64 
700:CONFIG_X86_AMD_PSTATE=y
701:CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
702:CONFIG_X86_AMD_PSTATE_UT=m

Thanks.

Note You need to log in before you can comment on or make changes to this bug.