Skip to content

Commit

Permalink
drm/amdgpu: No longer insert ras blocks into ras_list if it already e…
Browse files Browse the repository at this point in the history
…xists in ras_list

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

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
yipechai authored and alexdeucher committed Jan 14, 2022
1 parent df01fe7 commit df4f004
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
Expand Up @@ -2753,12 +2753,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);

Expand Down

0 comments on commit df4f004

Please sign in to comment.