[AMD Official Use Only - General]

Let's not rely on ras_enabled flags. It mixed with hw & sw ras caps. There is 
case that sw ras is disabled, but hardware is still ras capable.

The function actually relies on ras block list to decide if it does anything. 
If ras block is NULL, then it will be skipped by nature.

Let's revisit current implementation - basically it should walk through the ras 
block list before doing anything else.

Regards,
Hawking

-----Original Message-----
From: Wang, Yang(Kevin) <kevinyang.w...@amd.com>
Sent: Monday, March 18, 2024 08:55
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking <hawking.zh...@amd.com>; Zhou1, Tao <tao.zh...@amd.com>; 
Chai, Thomas <yipeng.c...@amd.com>; Wang, Yang(Kevin) <kevinyang.w...@amd.com>
Subject: [PATCH] drm/amdgpu: skip call ras_late_init if ras is not enabled

skip call ras_late_init if ras is not enabled.

Signed-off-by: Yang Wang <kevinyang.w...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 7d4a1bc30277..4ea35648fdfe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3391,10 +3391,14 @@ void amdgpu_ras_suspend(struct amdgpu_device *adev)

 int amdgpu_ras_late_init(struct amdgpu_device *adev)  {
+       struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
        struct amdgpu_ras_block_list *node, *tmp;
        struct amdgpu_ras_block_object *obj;
        int r;

+       if (!adev->ras_enabled || !con)
+               return 0;
+
        /* Guest side doesn't need init ras feature */
        if (amdgpu_sriov_vf(adev))
                return 0;
--
2.34.1

Reply via email to