All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block
@ 2022-01-12 10:38 yipechai
  2022-01-12 10:38 ` [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list yipechai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: yipechai @ 2022-01-12 10:38 UTC (permalink / raw)
  To: amd-gfx; +Cc: Tao.Zhou1, Hawking.Zhang, John.Clements, yipechai, yipechai

Add ras supported check for register_ras_block.

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index b1bedfd4febc..614ae8455c9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2757,6 +2757,9 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
 	if (!adev || !ras_block_obj)
 		return -EINVAL;
 
+	if (!amdgpu_ras_asic_supported(adev))
+		return 0;
+
 	INIT_LIST_HEAD(&ras_block_obj->node);
 	list_add_tail(&ras_block_obj->node, &adev->ras_list);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list
  2022-01-12 10:38 [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block yipechai
@ 2022-01-12 10:38 ` yipechai
  2022-01-13 18:00   ` Luben Tuikov
  2022-01-12 13:30 ` [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block Lazar, Lijo
  2022-01-13  3:20 ` Zhou1, Tao
  2 siblings, 1 reply; 5+ messages in thread
From: yipechai @ 2022-01-12 10:38 UTC (permalink / raw)
  To: amd-gfx; +Cc: Tao.Zhou1, Hawking.Zhang, John.Clements, yipechai, yipechai

No longer insert ras blocks into ras_list if it already exists in ras_list.

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 614ae8455c9f..d208fde509de 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2754,12 +2754,20 @@ 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)
 {
+	struct amdgpu_ras_block_object *obj, *tmp;
 	if (!adev || !ras_block_obj)
 		return -EINVAL;
 
 	if (!amdgpu_ras_asic_supported(adev))
 		return 0;
 
+	/* If the ras object is in ras_list, don't add it again */
+	list_for_each_entry_safe(obj, tmp, &adev->ras_list, node) {
+		if (obj == ras_block_obj) {
+			return 0;
+		}
+	}
+
 	INIT_LIST_HEAD(&ras_block_obj->node);
 	list_add_tail(&ras_block_obj->node, &adev->ras_list);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block
  2022-01-12 10:38 [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block yipechai
  2022-01-12 10:38 ` [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list yipechai
@ 2022-01-12 13:30 ` Lazar, Lijo
  2022-01-13  3:20 ` Zhou1, Tao
  2 siblings, 0 replies; 5+ messages in thread
From: Lazar, Lijo @ 2022-01-12 13:30 UTC (permalink / raw)
  To: yipechai, amd-gfx; +Cc: yipechai, Tao.Zhou1, John.Clements, Hawking.Zhang



On 1/12/2022 4:08 PM, yipechai wrote:
> Add ras supported check for register_ras_block.
> 
> Signed-off-by: yipechai <YiPeng.Chai@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index b1bedfd4febc..614ae8455c9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2757,6 +2757,9 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
>   	if (!adev || !ras_block_obj)
>   		return -EINVAL;
>   
> +	if (!amdgpu_ras_asic_supported(adev))
> +		return 0;
> +

Why to do this check here? This check can be done prior and IP's ras 
block can be set to NULL so that this function itself won't be called.

Thanks,
Lijo

>   	INIT_LIST_HEAD(&ras_block_obj->node);
>   	list_add_tail(&ras_block_obj->node, &adev->ras_list);
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block
  2022-01-12 10:38 [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block yipechai
  2022-01-12 10:38 ` [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list yipechai
  2022-01-12 13:30 ` [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block Lazar, Lijo
@ 2022-01-13  3:20 ` Zhou1, Tao
  2 siblings, 0 replies; 5+ messages in thread
From: Zhou1, Tao @ 2022-01-13  3:20 UTC (permalink / raw)
  To: Chai, Thomas, amd-gfx; +Cc: Clements, John, Zhang, Hawking

[AMD Official Use Only]

The series is:

Reviewed-by: Tao Zhou <tao.zhou1@amd.com>

> -----Original Message-----
> From: Chai, Thomas <YiPeng.Chai@amd.com>
> Sent: Wednesday, January 12, 2022 6:39 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Chai, Thomas <YiPeng.Chai@amd.com>; Zhang, Hawking
> <Hawking.Zhang@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Clements,
> John <John.Clements@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com>
> Subject: [PATCH V2 1/2] drm/amdgpu: Add ras supported check for
> register_ras_block
> 
> Add ras supported check for register_ras_block.
> 
> Signed-off-by: yipechai <YiPeng.Chai@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index b1bedfd4febc..614ae8455c9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2757,6 +2757,9 @@ int amdgpu_ras_register_ras_block(struct
> amdgpu_device *adev,
>  	if (!adev || !ras_block_obj)
>  		return -EINVAL;
> 
> +	if (!amdgpu_ras_asic_supported(adev))
> +		return 0;
> +
>  	INIT_LIST_HEAD(&ras_block_obj->node);
>  	list_add_tail(&ras_block_obj->node, &adev->ras_list);
> 
> --
> 2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list
  2022-01-12 10:38 ` [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list yipechai
@ 2022-01-13 18:00   ` Luben Tuikov
  0 siblings, 0 replies; 5+ messages in thread
From: Luben Tuikov @ 2022-01-13 18:00 UTC (permalink / raw)
  To: yipechai, amd-gfx
  Cc: Deucher, Alexander, yipechai, Tao.Zhou1, John.Clements, Hawking.Zhang

NAK.

This patch should be reverted.

We need to figure out why the block is being added and fix this there.

Regards,
Luben


On 2022-01-12 05:38, yipechai wrote:
> No longer insert ras blocks into ras_list if it already exists in ras_list.
>
> Signed-off-by: yipechai <YiPeng.Chai@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 614ae8455c9f..d208fde509de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2754,12 +2754,20 @@ 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)
>  {
> +	struct amdgpu_ras_block_object *obj, *tmp;
>  	if (!adev || !ras_block_obj)
>  		return -EINVAL;
>  
>  	if (!amdgpu_ras_asic_supported(adev))
>  		return 0;
>  
> +	/* If the ras object is in ras_list, don't add it again */
> +	list_for_each_entry_safe(obj, tmp, &adev->ras_list, node) {
> +		if (obj == ras_block_obj) {
> +			return 0;
> +		}
> +	}
> +
>  	INIT_LIST_HEAD(&ras_block_obj->node);
>  	list_add_tail(&ras_block_obj->node, &adev->ras_list);
>  


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-13 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 10:38 [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block yipechai
2022-01-12 10:38 ` [PATCH V2 2/2] drm/amdgpu: No longer insert ras blocks into ras_list if it already exists in ras_list yipechai
2022-01-13 18:00   ` Luben Tuikov
2022-01-12 13:30 ` [PATCH V2 1/2] drm/amdgpu: Add ras supported check for register_ras_block Lazar, Lijo
2022-01-13  3:20 ` Zhou1, Tao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.