drm/amd/pm: check the return of send smc msg for smu_v13
authorJesse Zhang <jesse.zhang@amd.com>
Wed, 8 May 2024 09:46:40 +0000 (17:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 20:11:53 +0000 (16:11 -0400)
Set smu work laod mask may fail, so check return.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

index 4f98869..a7d0231 100644 (file)
@@ -2499,8 +2499,10 @@ static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inp
                                                       smu->power_profile_mode);
        if (workload_type < 0)
                return -EINVAL;
-       smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,
+       ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,
                                    1 << workload_type, NULL);
+       if (ret)
+               dev_err(smu->adev->dev, "[%s] Failed to set work load mask!", __func__);
 
        return ret;
 }