diff options
author | Stanley.Yang <Stanley.Yang@amd.com> | 2022-03-10 16:55:09 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-03-15 21:34:34 +0300 |
commit | a29d44aea1aef0bc58d4951f2ddbe5b22d9a2e94 (patch) | |
tree | d17f5d0a5cd574b9c216b5e7ef6520acee4a7ea7 /drivers | |
parent | a03b288650abf2a92d5ecdaa737e3d04a2a77984 (diff) | |
download | linux-a29d44aea1aef0bc58d4951f2ddbe5b22d9a2e94.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c index 9a892d6d1d7a..89fbee568be4 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c @@ -643,11 +643,16 @@ int amdgpu_dpm_get_ecc_info(struct amdgpu_device *adev, void *umc_ecc) { struct smu_context *smu = adev->powerplay.pp_handle; + int ret = 0; if (!is_support_sw_smu(adev)) 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, |