[PATCH] drm: radeon: ci_dpm: Add error handling in ci_enable_vce_dpm()
Wentao Liang
vulab at iscas.ac.cn
Mon May 19 02:40:35 UTC 2025
The ci_enable_vce_dpm() calls ci_send_msg_to_smc_with_parameter()
but does not check the return value. A proper implementation can be
found in the ci_upload_dpm_level_enable_mask().
Add a check after calling ci_send_msg_to_smc_with_parameter(), return
-EINVAL if the sending fails.
Fixes: cc8dbbb4f62a ("drm/radeon: add dpm support for CI dGPUs (v2)")
Cc: stable at vger.kernel.org # v3.12
Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
---
drivers/gpu/drm/radeon/ci_dpm.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 3877863c6893..c4faaa16a5c4 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -3945,6 +3945,7 @@ static int ci_enable_vce_dpm(struct radeon_device *rdev, bool enable)
struct ci_power_info *pi = ci_get_pi(rdev);
const struct radeon_clock_and_voltage_limits *max_limits;
int i;
+ PPSMC_Result result;
if (rdev->pm.dpm.ac_power)
max_limits = &rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac;
@@ -3962,9 +3963,11 @@ static int ci_enable_vce_dpm(struct radeon_device *rdev, bool enable)
}
}
- ci_send_msg_to_smc_with_parameter(rdev,
- PPSMC_MSG_VCEDPM_SetEnabledMask,
- pi->dpm_level_enable_mask.vce_dpm_enable_mask);
+ result = ci_send_msg_to_smc_with_parameter(rdev,
+ PPSMC_MSG_VCEDPM_SetEnabledMask,
+ pi->dpm_level_enable_mask.vce_dpm_enable_mask);
+ if (result != PPSMC_Result_OK)
+ return -EINVAL;
}
return (ci_send_msg_to_smc(rdev, enable ?
--
2.42.0.windows.2
More information about the dri-devel
mailing list