[PATCH 2/2] drm/amdgpu: Optimize sdma ras block initialization code for sdma v4_0

Zhang, Hawking Hawking.Zhang at amd.com
Thu Jan 19 06:18:43 UTC 2023


[AMD Official Use Only - General]

Series is

Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>

Regards,
Hawking

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of YiPeng Chai
Sent: Thursday, January 19, 2023 13:00
To: amd-gfx at lists.freedesktop.org
Cc: Zhou1, Tao <Tao.Zhou1 at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>; Chai, Thomas <YiPeng.Chai at amd.com>; Li, Candice <Candice.Li at amd.com>; Chai, Thomas <YiPeng.Chai at amd.com>
Subject: [PATCH 2/2] drm/amdgpu: Optimize sdma ras block initialization code for sdma v4_0

Optimize sdma ras block initialization code for sdma v4_0.

Signed-off-by: YiPeng Chai <YiPeng.Chai at amd.com>
Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 017ae298558e..b5affba22156 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1851,6 +1851,11 @@ static int sdma_v4_0_sw_init(void *handle)
                }
        }

+       if (amdgpu_sdma_ras_sw_init(adev)) {
+               dev_err(adev->dev, "Failed to initialize sdma ras block!\n");
+               return -EINVAL;
+       }
+
        return r;
 }

@@ -2688,22 +2693,6 @@ static void sdma_v4_0_set_ras_funcs(struct amdgpu_device *adev)
                break;
        }

-       if (adev->sdma.ras) {
-               amdgpu_ras_register_ras_block(adev, &adev->sdma.ras->ras_block);
-
-               strcpy(adev->sdma.ras->ras_block.ras_comm.name, "sdma");
-               adev->sdma.ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__SDMA;
-               adev->sdma.ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
-               adev->sdma.ras_if = &adev->sdma.ras->ras_block.ras_comm;
-
-               /* If don't define special ras_late_init function, use default ras_late_init */
-               if (!adev->sdma.ras->ras_block.ras_late_init)
-                       adev->sdma.ras->ras_block.ras_late_init = amdgpu_sdma_ras_late_init;
-
-               /* If not defined special ras_cb function, use default ras_cb */
-               if (!adev->sdma.ras->ras_block.ras_cb)
-                       adev->sdma.ras->ras_block.ras_cb = amdgpu_sdma_process_ras_data_cb;
-       }
 }

 const struct amdgpu_ip_block_version sdma_v4_0_ip_block = {
--
2.25.1



More information about the amd-gfx mailing list