Bug 217567

Summary: amdgpu: [powerplay] hardcoded clock limits for vangogh APUs
Product: Drivers Reporter: Reuben Steenekamp (reuben.steenekamp)
Component: Video(Other)Assignee: drivers_video-other
Status: RESOLVED ANSWERED    
Severity: enhancement CC: reuben.steenekamp
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Reuben Steenekamp 2023-06-17 09:16:58 UTC
Overview:

Valve's SteamDeck uses an AMD Van Gogh APU. Given the target demographic for this device it common for overclocking to be done. The APUs clock ranges can be adjusted through the PowerPlay sysfs interface. However it is hard coded not to go above 3500Mhz. If device is overclocked, then users have two options: Either have the clock up to the max clock they have set in BIOS, or use the PowerPlay interface and be limited to up to 3500Mhz.

A solution might be to expose this hardcoded limit to userspace.

The hardcoded limit - https://github.com/torvalds/linux/blob/1639fae5132bc8a904af28d97cea0bedb3af802e/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c#L2101
The bounds check - https://github.com/torvalds/linux/blob/1639fae5132bc8a904af28d97cea0bedb3af802e/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c#L1972

Steps  to Reproduce: 

On a device with an overclocked AMD Van Gogh APU, attempt to set CCLK_RANGE max clock above 3500Mhz


Actual Results: 

amdgpu driver refuses to accept the changes


Expected Results:

Either amdgpu driver accepts the changes, or it refuses but has a way to change the limit without a modified kernel.

Hardware: Steam Deck, Van Gogh APU
Current build: Downsteam SteamOS fork: linux-neptune-headers-5.13.0.valve36-1. Present in all kernels with Van Gogh amdgpu drivers I believe.
Comment 1 Reuben Steenekamp 2023-06-17 13:46:14 UTC
* accidentally forgot to replace linux-neptune-headers-5.13.0.valve36-1 with 5.13.0
Comment 2 Artem S. Tashkinov 2023-06-17 16:06:59 UTC
This belongs here: https://gitlab.freedesktop.org/drm/amd/-/issues

Please refile.