[PATCH] drm/amdgpu: skip call ras_late_init if ras is not enabled

Zhang, Hawking Hawking.Zhang at amd.com
Mon Mar 18 02:06:14 UTC 2024


[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.Wang at amd.com>
Sent: Monday, March 18, 2024 08:55
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Zhou1, Tao <Tao.Zhou1 at amd.com>; Chai, Thomas <YiPeng.Chai at amd.com>; Wang, Yang(Kevin) <KevinYang.Wang at 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.wang at 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



More information about the amd-gfx mailing list