All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove the check of init status in psp_ras_initialize
@ 2022-11-10  7:04 Tao Zhou
  2022-11-10  8:18 ` Li, Candice
  0 siblings, 1 reply; 2+ messages in thread
From: Tao Zhou @ 2022-11-10  7:04 UTC (permalink / raw)
  To: amd-gfx, candice.li, hawking.zhang, yipeng.chai, stanley.yang; +Cc: Tao Zhou

The initialized status indicates RAS TA is loaded, but in some cases
(such as RAS fatal error) RAS TA could be destroyed although it's not
unloaded. Hence we load RAS TA unconditionally here.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 2fcb5bfbef89..0a8c30475dda 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1526,11 +1526,6 @@ int psp_ras_initialize(struct psp_context *psp)
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
-	if (psp->ras_context.context.initialized) {
-		dev_warn(adev->dev, "RAS WARN: TA has already been loaded\n");
-		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");
@@ -1602,6 +1597,9 @@ int psp_ras_initialize(struct psp_context *psp)
 	else {
 		if (ras_cmd->ras_status)
 			dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status);
+
+		/* fail to load RAS TA */
+		psp->ras_context.context.initialized = false;
 	}
 
 	return ret;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: remove the check of init status in psp_ras_initialize
  2022-11-10  7:04 [PATCH] drm/amdgpu: remove the check of init status in psp_ras_initialize Tao Zhou
@ 2022-11-10  8:18 ` Li, Candice
  0 siblings, 0 replies; 2+ messages in thread
From: Li, Candice @ 2022-11-10  8:18 UTC (permalink / raw)
  To: Zhou1, Tao, amd-gfx, Zhang, Hawking, Chai, Thomas, Yang, Stanley
  Cc: Zhou1, Tao

[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

[Public]

Reviewed-by: Candice Li <candice.li@amd.com<mailto:candice.li@amd.com>>


Thanks
Candice
________________________________
From: Zhou1, Tao <Tao.Zhou1@amd.com>
Sent: Thursday, November 10, 2022 3:04:00 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Li, Candice <Candice.Li@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com>; Yang, Stanley <Stanley.Yang@amd.com>
Cc: Zhou1, Tao <Tao.Zhou1@amd.com>
Subject: [PATCH] drm/amdgpu: remove the check of init status in psp_ras_initialize

The initialized status indicates RAS TA is loaded, but in some cases
(such as RAS fatal error) RAS TA could be destroyed although it's not
unloaded. Hence we load RAS TA unconditionally here.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 2fcb5bfbef89..0a8c30475dda 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1526,11 +1526,6 @@ int psp_ras_initialize(struct psp_context *psp)
         if (amdgpu_sriov_vf(adev))
                 return 0;

-       if (psp->ras_context.context.initialized) {
-               dev_warn(adev->dev, "RAS WARN: TA has already been loaded\n");
-               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");
@@ -1602,6 +1597,9 @@ int psp_ras_initialize(struct psp_context *psp)
         else {
                 if (ras_cmd->ras_status)
                         dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status);
+
+               /* fail to load RAS TA */
+               psp->ras_context.context.initialized = false;
         }

         return ret;
--
2.35.1


[-- Attachment #2: Type: text/html, Size: 4452 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-10  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10  7:04 [PATCH] drm/amdgpu: remove the check of init status in psp_ras_initialize Tao Zhou
2022-11-10  8:18 ` Li, Candice

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.