[PATCH] drm/amd: Avoid running psp_ras_initialize() on HW without RAS

Zhang, Hawking Hawking.Zhang at amd.com
Thu Jul 6 00:28:29 UTC 2023


[AMD Official Use Only - General]

The change doesn't make sense at all, especially for some ASIC where it is allowed enable/disable RAS config through RAS TA. i.e. set ras_enable==0 and the issue commands to RAS TA to change the RAS config.

It doesn't matter whether ras code path is enabled or not, but ras firmware, as long as it is built-in for the asic, it needs to be loaded.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Mario Limonciello
Sent: Thursday, July 6, 2023 00:53
To: amd-gfx at lists.freedesktop.org
Cc: Limonciello, Mario <Mario.Limonciello at amd.com>
Subject: [PATCH] drm/amd: Avoid running psp_ras_initialize() on HW without RAS

On hardware known not to have RAS or in cases that a user has disabled RAS via kernel module parameter, it makes no sense to try to run code from psp_ras_initialize().  Furthermore trying to run it shows the following message on every boot:

`RAS: optional ras ta ucode is not available`

Avoid running the rest of the function is RAS is not available.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1415
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2673
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index c2508462e02f..a87b6c761e78 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1603,6 +1603,9 @@ int psp_ras_initialize(struct psp_context *psp)
        if (amdgpu_sriov_vf(adev))
                return 0;

+       if (!adev->ras_enabled)
+               return 0;
+
        if (!adev->psp.ras_context.context.bin_desc.size_bytes ||
            !adev->psp.ras_context.context.bin_desc.start_addr) {
                dev_info(adev->dev, "RAS: optional ras ta ucode is not available\n");
--
2.34.1



More information about the amd-gfx mailing list