[PATCH 03/11] drm/amdgpu: Init gfx ras block when ras is supported

Yang, Stanley Stanley.Yang at amd.com
Mon Mar 6 06:31:34 UTC 2023


I have one additional suggestion, the amdgpu_gfx_ras_sw_init is declared twice in amdgpu_gfx.h file, it can be removed one in this patch.

Regards,
Stanley
> -----Original Message-----
> From: Zhang, Hawking <Hawking.Zhang at amd.com>
> Sent: Monday, March 6, 2023 10:32 AM
> To: amd-gfx at lists.freedesktop.org; Zhou1, Tao <Tao.Zhou1 at amd.com>;
> Yang, Stanley <Stanley.Yang at amd.com>; Li, Candice <Candice.Li at amd.com>;
> Chai, Thomas <YiPeng.Chai at amd.com>
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>
> Subject: [PATCH 03/11] drm/amdgpu: Init gfx ras block when ras is supported
> 
> Initialize gfx ras block only when gfx ip block supports ras features.
> 
> Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 ++++++---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 9 ++++++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 3bf697a80cf2..d7d4847e2644 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -1409,9 +1409,12 @@ static int gfx_v11_0_sw_init(void *handle)
>  	if (r)
>  		return r;
> 
> -	if (amdgpu_gfx_ras_sw_init(adev)) {
> -		dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
> -		return -EINVAL;
> +	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) {
> +		r = amdgpu_gfx_ras_sw_init(adev);
> +		if (r) {
> +			dev_err(adev->dev, "Failed to initialize gfx ras
> block!\n");
> +			return r;
> +		}
>  	}
> 
>  	return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index ae09fc1cfe6b..c9657e89d40e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -2177,9 +2177,12 @@ static int gfx_v9_0_sw_init(void *handle)
>  	if (r)
>  		return r;
> 
> -	if (amdgpu_gfx_ras_sw_init(adev)) {
> -		dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
> -		return -EINVAL;
> +	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) {
> +		r = amdgpu_gfx_ras_sw_init(adev);
> +		if (r) {
> +			dev_err(adev->dev, "Failed to initialize gfx ras
> block!\n");
> +			return r;
> +		}
>  	}
> 
>  	return 0;
> --
> 2.17.1



More information about the amd-gfx mailing list