]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/pm: fix smu13 power limit default/cap calculation
authorYang Wang <kevinyang.wang@amd.com>
Tue, 19 May 2026 03:18:12 +0000 (11:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jun 2026 18:50:58 +0000 (14:50 -0400)
commitbb204f19e4a115f094a6a3c4d82fcf48862d0766
treeeb8d6dd361126b01301db2b3212e3eb438523281
parent2493d87bb4c31ec9ca7f0ef7257e33b8b175f913
drm/amd/pm: fix smu13 power limit default/cap calculation

smu_v13_0_0_get_power_limit() and smu_v13_0_7_get_power_limit() mix
runtime power_limit with PP table limits when reporting default/min/max.

When current power limit query succeeds, default_power_limit was set to the
runtime value instead of the PP table default, and min/max could be derived
from inconsistent bases (MsgLimits/runtime), leading to incorrect cap info.

Use SocketPowerLimitAc/Dc as the PP default base (pp_limit), keep
current_power_limit as runtime value, and derive min/max from pp_limit with
OD percentages.

Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5227
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1eaf26db95901ca70737503a89b831dd763c8453)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c