How to use AMD P-State in Linux

kernel maintainer contacted, now it’s waiting i guess

I must be missing something though.
That guy who reported that issue here: https://bugzilla.kernel.org/show_bug.cgi?id=216248 says it’s fixed for him with that patch although he also has

Model name: AMD Ryzen 7 5800HS with Radeon Graphics
CPU family: 25
Model: 80

let see what happens, the maintainer will for sure check more stuff also. I’m already more than happy he will have a look at it.

By the way the cpu in the Asus is:

Model name: AMD Ryzen 7 5800H with Radeon Graphics

not 5800HS

same family and model though.

AFAIK the only real difference is clocks/tdp between the 2

Wait, did you put the shared_mem=1 ? You shouldn’t because that CPU supports the MSR way of doing things.

Huh? Sounds like you don’t even have that module installed. Are you using the regular kernel?

major difference is TDP 5800H is 45W while 5800HS is 35W but you’re correct it’s the same family

i have Linux-AMD installed but even when i run the Linux arch kernel it doesn’t work

Still 5.18.10 Linux-AMD kernel it worked fine so must be something else for sure

Ok, I think now I understand it.

The fix for the issue with processors only supporting the shared memory implementation (like the Zen3 desktop CPU’s) was already merged into 5.18.12

But there is yet another issue for some CPU’s that do support the MSR implementation.
That is presumably fixed with this patch: https://bugzilla.kernel.org/attachment.cgi?id=301440&action=diff
However, that patch did not yet get into the kernel.

linux-amd                 5.18.v.13-1  ->  5.18.v.14-1  82,62 MiB
linux-amd-headers         5.18.v.13-1  ->  5.18.v.14-1  13,89 MiB

Tested a first test kernel received from the Linux-AMD maintainer and with changes as moson reported firstly, still no luck on getting P-state running.

Reported back already all related info and also the second bug reported on bugzilla. https://bugzilla.kernel.org/attachment.cgi?id=301440&action=diff

Once and if the maintainer send me a new test version i will test and report back here on the results.

Is the boost flag set to 1 in /sys/devices/system/cpu/cpufreq/boost

it is, cat /sys/devices/system/cpu/cpufreq/boost returns 1

1 Like

I have the same cpu as @Chinaboy5216 and amd_pstate works using the mainline kernel from miffe. My trackpad does not work though… But atleast the patch mentioned before will fix the driver. The patch was introduced in 5.19.0-rc8.

Some extra info:

lscpu:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          16
On-line CPU(s) list:             0-15
Vendor ID:                       AuthenticAMD
Model name:                      AMD Ryzen 7 5800H with Radeon Graphics
CPU family:                      25
Model:                           80
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
Stepping:                        0
Frequency boost:                 enabled
CPU(s) scaling MHz:              38%
CPU max MHz:                     3200.0000
CPU min MHz:                     1200.0000
BogoMIPS:                        6390.95
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm

uname -a:

Linux 16ACH 5.19.0-rc8-1-mainline #1 SMP PREEMPT_DYNAMIC Sun, 24 Jul 2022 21:17:05 +0000 x86_64 GNU/Linux

cpupower frequency-info:

analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 4.46 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 400 MHz and 4.46 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 2.33 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.46 GHz.
    AMD PSTATE Nominal Performance: 119. Nominal Frequency: 3.20 GHz.
    AMD PSTATE Lowest Non-linear Performance: 41. Lowest Non-linear Frequency: 1.10 GHz.
    AMD PSTATE Lowest Performance: 15. Lowest Frequency: 400 MHz.
1 Like

thanks for mentioning this, will try the kernel and see what happens!!

Well AMD P-State is back also here!!

Thanks for posting this here mate!! Appreciate it. I also already informed the Linux-AMD maintainer on this one.

1 Like

so mobile ryzens needs another change… as the Ryzen 9 5800x already worked with 5.18.14

The patch mentioned by @moson has landed in stable 5.18.15! Amd pstate should work on the regular kernel now.