drm/amd/pm: use pm mutex to protect ecc info table

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Stanley.Yang 2022-03-10 21:55:09 +08:00 committed by Alex Deucher
parent a03b288650
commit a29d44aea1

View File

@ -643,11 +643,16 @@ int amdgpu_dpm_get_ecc_info(struct amdgpu_device *adev,
void *umc_ecc) void *umc_ecc)
{ {
struct smu_context *smu = adev->powerplay.pp_handle; struct smu_context *smu = adev->powerplay.pp_handle;
int ret = 0;
if (!is_support_sw_smu(adev)) if (!is_support_sw_smu(adev))
return -EOPNOTSUPP; return -EOPNOTSUPP;
return smu_get_ecc_info(smu, umc_ecc); mutex_lock(&adev->pm.mutex);
ret = smu_get_ecc_info(smu, umc_ecc);
mutex_unlock(&adev->pm.mutex);
return ret;
} }
struct amd_vce_state *amdgpu_dpm_get_vce_clock_state(struct amdgpu_device *adev, struct amd_vce_state *amdgpu_dpm_get_vce_clock_state(struct amdgpu_device *adev,