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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux