amdgpu: [powerplay] hardcoded clock limits for vangogh APUs
Describe the problem
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.
The hardcoded limit (cpu_default_soft_max_freq) - 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
Describe the new feature behavior
Expose a module parameter or sysfs interface to modify cpu_default_soft_max_freq
. One could do so similarly for cpu_default_soft_min_freq
, albeit with less motivation to do so.
This opens up questions on what the behavior should be if this violates the invariant that cpu_actual_soft_max_freq
<= cpu_default_soft_max_freq
. If it is passed as module parameter, it should only take effect once at start, sidestepping the problem.
Describe the target user/application
For users that do not touch this interface, it will have no impact for them. For users with overclocked devices that wish to adjust their clock speeds through the powerplay interface, as done in PowerTools, and do so beyond 3500Mhz they will have the ability to do so.