Bug 217618 - Changing maximum frequency and boost state does not work with amd-pstate in passive mode plus the schedutil governor
Summary: Changing maximum frequency and boost state does not work with amd-pstate in p...
Status: RESOLVED CODE_FIX
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: 2023-07-01 08:21 UTC by Prajna Sariputra
Modified: 2024-05-22 02:12 UTC (History)
2 users (show)

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


Attachments

Description Prajna Sariputra 2023-07-01 08:21:17 UTC
I have a HP Omen 16-n0000 laptop with a Ryzen 7 6800H, and if I have amd-pstate set to passive mode (either by booting with `amd_pstate=passive` kernel cmdline or by running `echo "passive" | sudo tee /sys/devices/system/cpu/amd_pstate/status` on runtime) and the governor left to the default schedutil then changing the maximum allowed frequency (via `sudo cpupower frequency-set -g 3200MHz` for example) does nothing, the CPU frequencies (and temperatures along with it) still goes up high. Disabling boost via `echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost` also does not work with the schedutil governor.

However, if I switch to the ondemand governor then both the boost and maximum frequency settings work as expected.

The distro I am using is Arch Linux, with kernel 6.4.0 from the testing repo, although this issue has been present since at least kernel 6.2.x when I first got this laptop. I can recompile the kernel myself to test patches if there are any.

Also, for what it's worth amd-pstate in guided mode also ignores both the maximum frequency and boost knobs, but it does that with both the schedutil and ondemand governors so I guess that's expected(?).
Comment 1 Perry Yuan(AMD) 2023-07-03 01:39:56 UTC
Hi Sariputra, 

thank you for reporting this issue, could you let me know the values of your system?

# cat /sys/devices/system/cpu/cpu*/cpufreq/amd_pstate_max_freq
# cat /sys/devices/system/cpu/cpu*/acpi_cppc/highest_perf

Perry.
Comment 2 Prajna Sariputra 2023-07-03 02:41:42 UTC
Here is the output of the first command:
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000
4785000

And here is the output for the second one:
191
196
196
166
166
186
186
191
181
181
176
176
196
196
171
171
Comment 3 Perry Yuan(AMD) 2023-07-03 08:11:34 UTC
Thanks for your info share, I guess the boost and scaling_max have something need to be improved when user try to limit the max frequency.
Comment 4 Perry Yuan(AMD) 2023-10-16 02:46:17 UTC
I have implemented a new boost control with a patchset that are under internal viewing. it works for both the passive and active mode.
Comment 5 Prajna Sariputra 2024-05-21 13:09:56 UTC
With kernel 6.9.0, it looks like limiting the frequency control now works in both active and passive mode, and in the latter case both the schedutil and ondemand governors respect the frequency limit, so this appears to be fixed for me, thanks!
Comment 6 Perry Yuan(AMD) 2024-05-22 02:12:57 UTC
(In reply to Prajna Sariputra from comment #5)
> With kernel 6.9.0, it looks like limiting the frequency control now works in
> both active and passive mode, and in the latter case both the schedutil and
> ondemand governors respect the frequency limit, so this appears to be fixed
> for me, thanks!

good to know that. 
thanks for your feedback. 

Perry.

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