On 1/12/2022 4:08 PM, yipechai wrote:
Add ras supported check for register_ras_block.
Signed-off-by: yipechai <YiPeng.Chai@xxxxxxx>
---
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);