All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: update RAS error handling
@ 2020-04-30  8:30 Clements, John
  2020-04-30  9:12 ` Zhang, Hawking
  0 siblings, 1 reply; 2+ messages in thread
From: Clements, John @ 2020-04-30  8:30 UTC (permalink / raw)
  To: Zhang, Hawking, amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 173 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Submitting patch for review to parse return status from TA to determine error severity

Thank you,
John Clements

[-- Attachment #1.2: Type: text/html, Size: 2008 bytes --]

[-- Attachment #2: 0001-drm-amdgpu-update-RAS-error-handling.patch --]
[-- Type: application/octet-stream, Size: 2468 bytes --]

From 49fc0b9ea19e0a44d1872f0fc658cc39d51ef6be Mon Sep 17 00:00:00 2001
From: John Clements <john.clements@amd.com>
Date: Thu, 30 Apr 2020 16:25:50 +0800
Subject: [PATCH] drm/amdgpu: update RAS error handling

Parse return status from TA to determine error severity

Signed-off-by: John Clements <john.clements@amd.com>
Change-Id: Id3fa5c18030581c8c7b79349f33a6845b5bb0de5
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 40 +++++++++++++++++++------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 8b14aee370c8..538895cfd862 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -502,6 +502,29 @@ struct ras_manager *amdgpu_ras_find_obj(struct amdgpu_device *adev,
 }
 /* obj end */
 
+void amdgpu_ras_parse_status_code(struct amdgpu_device* adev,
+				  const char* 		invoke_type,
+				  const char* 		block_name,
+				  enum ta_ras_status 	ret)
+{
+	switch (ret) {
+	case TA_RAS_STATUS__SUCCESS:
+		return;
+	case TA_RAS_STATUS__ERROR_RAS_NOT_AVAILABLE:
+		dev_warn(adev->dev,
+			"RAS WARN: %s %s currently unavailable\n",
+			invoke_type,
+			block_name);
+		break;
+	default:
+		dev_err(adev->dev,
+			"RAS ERROR: %s %s error failed ret 0x%X\n",
+			invoke_type,
+			block_name,
+			ret);
+	}
+}
+
 /* feature ctl begin */
 static int amdgpu_ras_is_feature_allowed(struct amdgpu_device *adev,
 		struct ras_common_if *head)
@@ -592,11 +615,10 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
 	if (!amdgpu_ras_intr_triggered()) {
 		ret = psp_ras_enable_features(&adev->psp, &info, enable);
 		if (ret) {
-			dev_err(adev->dev, "RAS ERROR: %s %s feature "
-					"failed ret %d\n",
-					enable ? "enable":"disable",
-					ras_block_str(head->block),
-					ret);
+			amdgpu_ras_parse_status_code(adev,
+						     enable ? "enable":"disable",
+						     ras_block_str(head->block),
+						    (enum ta_ras_status)ret);
 			if (ret == TA_RAS_STATUS__RESET_NEEDED)
 				return -EAGAIN;
 			return -EINVAL;
@@ -821,10 +843,10 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev,
 		ret = -EINVAL;
 	}
 
-	if (ret)
-		dev_err(adev->dev, "RAS ERROR: inject %s error failed ret %d\n",
-				ras_block_str(info->head.block),
-				ret);
+	amdgpu_ras_parse_status_code(adev,
+				     "inject",
+				     ras_block_str(info->head.block),
+				     (enum ta_ras_status)ret);
 
 	return ret;
 }
-- 
2.17.1


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu: update RAS error handling
  2020-04-30  8:30 [PATCH] drm/amdgpu: update RAS error handling Clements, John
@ 2020-04-30  9:12 ` Zhang, Hawking
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Hawking @ 2020-04-30  9:12 UTC (permalink / raw)
  To: Clements, John, amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 521 bytes --]

[AMD Official Use Only - Internal Distribution Only]

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

Regards,
Hawking
From: Clements, John <John.Clements@amd.com>
Sent: Thursday, April 30, 2020 16:31
To: Zhang, Hawking <Hawking.Zhang@amd.com>; amd-gfx@lists.freedesktop.org
Subject: [PATCH] drm/amdgpu: update RAS error handling


[AMD Official Use Only - Internal Distribution Only]

Submitting patch for review to parse return status from TA to determine error severity

Thank you,
John Clements

[-- Attachment #1.2: Type: text/html, Size: 3259 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-04-30  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  8:30 [PATCH] drm/amdgpu: update RAS error handling Clements, John
2020-04-30  9:12 ` Zhang, Hawking

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.