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

Mario Limonciello mario.limonciello at amd.com
Wed Jul 5 16:52:49 UTC 2023


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