[PATCH 05/21] drm/amdgpu: refine sdma4 ras_data_cb

Zhou1, Tao Tao.Zhou1 at amd.com
Mon Sep 23 11:34:22 UTC 2019


I'll add a new patch.

Regards,
Tao

> -----Original Message-----
> From: Zhang, Hawking <Hawking.Zhang at amd.com>
> Sent: 2019年9月19日 22:48
> To: Chen, Guchun <Guchun.Chen at amd.com>; Zhou1, Tao
> <Tao.Zhou1 at amd.com>; amd-gfx at lists.freedesktop.org
> Subject: RE: [PATCH 05/21] drm/amdgpu: refine sdma4 ras_data_cb
> 
> Let's add comments to clarifying why checking GFX IP BLOCK for SDMA
> interrupt so people will not be confusing here.
> 
> Regards,
> Hawking
> 
> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen at amd.com>
> Sent: 2019年9月19日 21:59
> To: Zhou1, Tao <Tao.Zhou1 at amd.com>; amd-gfx at lists.freedesktop.org;
> Zhang, Hawking <Hawking.Zhang at amd.com>
> Subject: RE: [PATCH 05/21] drm/amdgpu: refine sdma4 ras_data_cb
> 
> 
> 
> 
> Regards,
> Guchun
> 
> -----Original Message-----
> From: Zhou1, Tao <Tao.Zhou1 at amd.com>
> Sent: Thursday, September 19, 2019 3:13 PM
> To: amd-gfx at lists.freedesktop.org; Chen, Guchun
> <Guchun.Chen at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
> Cc: Zhou1, Tao <Tao.Zhou1 at amd.com>
> Subject: [PATCH 05/21] drm/amdgpu: refine sdma4 ras_data_cb
> 
> simplify code logic and refine return value
> 
> Signed-off-by: Tao Zhou <tao.zhou1 at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 32 ++++++++++++++------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index a8e4b7d880fe..f685a2377615 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -1942,25 +1942,27 @@ static int
> sdma_v4_0_process_ras_data_cb(struct amdgpu_device *adev,
>  	uint32_t err_source;
>  	int instance;
> 
> -	if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) {
> -		instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
> -		if (instance < 0)
> -			return 0;
> +	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
> +		goto out;
> 
> -		switch (entry->src_id) {
> -		case SDMA0_4_0__SRCID__SDMA_SRAM_ECC:
> -			err_source = 0;
> -			break;
> -		case SDMA0_4_0__SRCID__SDMA_ECC:
> -			err_source = 1;
> -			break;
> -		default:
> -			return 0;
> -		}
> +	instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
> +	if (instance < 0)
> +		goto out;
> 
> -		amdgpu_sdma_process_ras_data_cb(adev, err_data, entry);
> +	switch (entry->src_id) {
> +	case SDMA0_4_0__SRCID__SDMA_SRAM_ECC:
> +		err_source = 0;
> [Guchun]Looks no one uses this variable. Can we remove it directly? I am not
> sure why we added one switch case here.
> 
> +		break;
> +	case SDMA0_4_0__SRCID__SDMA_ECC:
> +		err_source = 1;
> +		break;
> +	default:
> +		goto out;
>  	}
> 
> +	amdgpu_sdma_process_ras_data_cb(adev, err_data, entry);
> +
> +out:
>  	return AMDGPU_RAS_SUCCESS;
>  }
> 
> --
> 2.17.1



More information about the amd-gfx mailing list