smu_v13_0_0_get_power_limit() queried the current PPT limit into a local
power_limit variable, but never copied that value back to the caller on
the successful path. As a result, callers requesting current_power_limit
did not receive the value returned by the SMU.

Fixes: 8c658297a4db ("drm/amd/pm: fix smu13 power limit default/cap 
calculation")
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5416

Signed-off-by: Yang Wang <[email protected]>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index c984dce48310..19ff9b14e772 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -2404,11 +2404,11 @@ static int smu_v13_0_0_get_power_limit(struct 
smu_context *smu,
        uint32_t pp_limit = smu->adev->pm.ac_power ?
                              skutable->SocketPowerLimitAc[PPT_THROTTLER_PPT0] :
                              skutable->SocketPowerLimitDc[PPT_THROTTLER_PPT0];
-       uint32_t power_limit = 0, od_percent_upper = 0, od_percent_lower = 0;
+       uint32_t od_percent_upper = 0, od_percent_lower = 0;
        int ret;
 
        if (current_power_limit) {
-               ret = smu_v13_0_get_current_power_limit(smu, &power_limit);
+               ret = smu_v13_0_get_current_power_limit(smu, 
current_power_limit);
                if (ret)
                        *current_power_limit = pp_limit;
        }
-- 
2.47.3

Reply via email to