drm/amdgpu/swsmu/aldebaran: fix check in is_dpm_running
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 03:47:02 +0000 (23:47 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 16:33:52 +0000 (12:33 -0400)
If smu_cmn_get_enabled_mask() fails, return false to be
consistent with other asics.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Lee Jones <lee.jones@linaro.org>
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

index d6ce665baaf3b36c06f34c81e17bb527cf0736da..7a1abb3d6a7a5814ee18d7ece1f9bcd559221e16 100644 (file)
@@ -1368,10 +1368,13 @@ static int aldebaran_usr_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_
 
 static bool aldebaran_is_dpm_running(struct smu_context *smu)
 {
-       int ret = 0;
+       int ret;
        uint32_t feature_mask[2];
        unsigned long feature_enabled;
+
        ret = smu_cmn_get_enabled_mask(smu, feature_mask, 2);
+       if (ret)
+               return false;
        feature_enabled = (unsigned long)((uint64_t)feature_mask[0] |
                                          ((uint64_t)feature_mask[1] << 32));
        return !!(feature_enabled & SMC_DPM_FEATURE);