NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/59932: Setting CPU frequencies on Zen 3 systems is problematic



Hi,

> On multiple Zen 3 systems (Ryzen 5500, 5700X):
> 
> sysctl -a | grep freq
> machdep.dmi.processor-frequency = 3400 MHz
> machdep.tsc_freq = 3393633000
> machdep.cpu.frequency.target = 3400
> machdep.cpu.frequency.current = 3400
> machdep.cpu.frequency.available = 3400 2800 2200
> 
> Changing the frequency works. However, after setting frequency.target to 3401 (which is 3400, with turbo clocking enabled, IIRC), all future attempts to set the clock fail:
> 
> sysctl -w machdep.cpu.frequency.target=3400
> sysctl: machdep.cpu.frequency.target: Device not configured
> sysctl -w machdep.cpu.frequency.target=2200
> sysctl: machdep.cpu.frequency.target: Device not configured
> 
> On each attempt to change CPU frequency, the kernel prints:
> 
> [ 2823136.558871] acpicpu0: autoconfiguration error: failed to get frequency (err 22)
> [ 2823141.718910] acpicpu1: autoconfiguration error: failed to get frequency (err 22)

from source inspection, returning an EINVAL seems like this particular machine uses a 
Fixed Hardware address space ACPI type and has no support for AMD “VID/FID” algorithm 
for intermediate dynamic adjustments of Pstates. so it matches to an invalid status address (0) for the unknown 
Pstate that you are trying to change to (3401). 

https://www.netbsd.org/docs/guide/en/chap-power.html

you can “usually" verify that if your reported frequencies end in 1. looks like this man page reveals a 
software layer aid to that but seems to be inneficient as compared to hardware support. 

can you check dmesg to see if P state FIDVID flag is seen on acpicpu ? and maybe compare to the other machines ?
If it lacks the support, maybe you simply can’t do that due to hardware limitation.

NB: this is just by source inspection. hope it helps.



Emmanuel







Home | Main Index | Thread Index | Old Index