[PATCH] drm/amdgpu: Fix NULL pointer when ta is missing

Zhang, Hawking Hawking.Zhang at amd.com
Mon Mar 11 05:41:59 UTC 2019


Would it make sense to check ta fw availability before call into psp_ras_initialize? In such way, we can avoid unnecessary device error kernel message that complains ras init failure on the ASICs that actually don’t have RAS support. Accordingly, you need similar logic before call into psp_ras_terminate in hw_fini phase.

Regards,
Hawking
From: Pan, Xinhui <Xinhui.Pan at amd.com>
Sent: 2019年3月11日 12:23
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>; Gao, Likun <Likun.Gao at amd.com>
Subject: [PATCH] drm/amdgpu: Fix NULL pointer when ta is missing

Ta is optional, so check if ta firmware is loaded or not.

Signed-off-by: xinhui pan <xinhui.pan at amd.com<mailto:xinhui.pan 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 7e3e1d588d74..0bd9df9fd289 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -656,6 +656,9 @@ static int psp_ras_initialize(struct psp_context *psp)
{
             int ret;

+            if (!psp->adev->psp.ta_fw)
+                           return -ENOENT;
+
             if (!psp->ras.ras_initialized) {
                            ret = psp_ras_init_shared_buf(psp);
                            if (ret)
--
2.17.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190311/cc0b71e7/attachment.html>


More information about the amd-gfx mailing list