[PATCH Review 1/1] drm/amd/pm: use pm mutex to protect ecc info table

Quan, Evan Evan.Quan at amd.com
Thu Mar 10 14:15:28 UTC 2022


[AMD Official Use Only]

Reviewed-by: Evan Quan <evan.quan at amd.com>

> -----Original Message-----
> From: Stanley.Yang <Stanley.Yang at amd.com>
> Sent: Thursday, March 10, 2022 10:02 PM
> To: amd-gfx at lists.freedesktop.org; Zhang, Hawking
> <Hawking.Zhang at amd.com>; Zhou1, Tao <Tao.Zhou1 at amd.com>; Li,
> Candice <Candice.Li at amd.com>; Quan, Evan <Evan.Quan at amd.com>
> Cc: Yang, Stanley <Stanley.Yang at amd.com>
> Subject: [PATCH Review 1/1] drm/amd/pm: use pm mutex to protect ecc
> info table
> 
> Change-Id: I6afe0332cbb20528648c38665264930d6b091c2f
> Signed-off-by: Stanley.Yang <Stanley.Yang at amd.com>
> ---
>  drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 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,
> --
> 2.17.1


More information about the amd-gfx mailing list