RE: [PATCH 1/2] drm/amdgpu: Add a filter condition to restrict the SW ras function to be registered only by asics whose hardware supports the ras function

2022-01-12 Thread Chai, Thomas



-Original Message-
From: Zhou1, Tao  
Sent: Wednesday, January 12, 2022 4:28 PM
To: Chai, Thomas ; amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking ; Clements, John 

Subject: RE: [PATCH 1/2] drm/amdgpu: Add a filter condition to restrict the SW 
ras function to be registered only by asics whose hardware supports the ras 
function

[AMD Official Use Only]



> -Original Message-
> From: Chai, Thomas 
> Sent: Wednesday, January 12, 2022 3:48 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Chai, Thomas ; Zhang, Hawking 
> ; Zhou1, Tao ; Clements, 
> John ; Chai, Thomas 
> Subject: [PATCH 1/2] drm/amdgpu: Add a filter condition to restrict 
> the SW ras function to be registered only by asics whose hardware 
> supports the ras function

>[Tao] The subject is too long, I think "add ras supported check for 
>register_ras_block" is enough.
[Thomas] Ok.

> 
> Add a filter condition to restrict the SW ras function to be 
> registered only by asics whose hardware supports the ras function.
> 
> Signed-off-by: yipechai 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index b1bedfd4febc..62be0b4909b3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2754,7 +2754,7 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device
> *adev)  int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
>   struct amdgpu_ras_block_object* ras_block_obj)  {
> - if (!adev || !ras_block_obj)
> + if (!adev || !amdgpu_ras_asic_supported(adev) || !ras_block_obj)
>   return -EINVAL;

>[Tao] Can we return 0 if !amdgpu_ras_asic_supported(adev)? It's not an error.
[Thomas] OK.

> 
>   INIT_LIST_HEAD(_block_obj->node);
> --
> 2.25.1


RE: [PATCH 1/2] drm/amdgpu: Add a filter condition to restrict the SW ras function to be registered only by asics whose hardware supports the ras function

2022-01-12 Thread Zhou1, Tao
[AMD Official Use Only]



> -Original Message-
> From: Chai, Thomas 
> Sent: Wednesday, January 12, 2022 3:48 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Chai, Thomas ; Zhang, Hawking
> ; Zhou1, Tao ; Clements,
> John ; Chai, Thomas 
> Subject: [PATCH 1/2] drm/amdgpu: Add a filter condition to restrict the SW ras
> function to be registered only by asics whose hardware supports the ras 
> function

[Tao] The subject is too long, I think "add ras supported check for 
register_ras_block" is enough.

> 
> Add a filter condition to restrict the SW ras function to be registered only 
> by
> asics whose hardware supports the ras function.
> 
> Signed-off-by: yipechai 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index b1bedfd4febc..62be0b4909b3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2754,7 +2754,7 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device
> *adev)  int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
>   struct amdgpu_ras_block_object* ras_block_obj)  {
> - if (!adev || !ras_block_obj)
> + if (!adev || !amdgpu_ras_asic_supported(adev) || !ras_block_obj)
>   return -EINVAL;

[Tao] Can we return 0 if !amdgpu_ras_asic_supported(adev)? It's not an error.

> 
>   INIT_LIST_HEAD(_block_obj->node);
> --
> 2.25.1


[PATCH 1/2] drm/amdgpu: Add a filter condition to restrict the SW ras function to be registered only by asics whose hardware supports the ras function

2022-01-11 Thread yipechai
Add a filter condition to restrict the SW ras function to be registered only by 
asics whose hardware supports the ras function.

Signed-off-by: yipechai 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index b1bedfd4febc..62be0b4909b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2754,7 +2754,7 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)
 int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
struct amdgpu_ras_block_object* ras_block_obj)
 {
-   if (!adev || !ras_block_obj)
+   if (!adev || !amdgpu_ras_asic_supported(adev) || !ras_block_obj)
return -EINVAL;
 
INIT_LIST_HEAD(_block_obj->node);
-- 
2.25.1