amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: add support for ras init flags
@ 2021-04-21  6:56 Clements, John
  2021-04-21  7:00 ` Zhang, Hawking
  0 siblings, 1 reply; 2+ messages in thread
From: Clements, John @ 2021-04-21  6:56 UTC (permalink / raw)
  To: amd-gfx, Zhang, Hawking


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

[AMD Official Use Only - Internal Distribution Only]

Submitting patch to select RAS dGPU mode/poison propagation mode

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

[-- Attachment #2: 0001-drm-amdgpu-add-support-for-ras-init-flags.patch --]
[-- Type: application/octet-stream, Size: 2504 bytes --]

From 1cbd7def29a33c4d00c05f2bce8fb6d71292be15 Mon Sep 17 00:00:00 2001
From: John Clements <john.clements@amd.com>
Date: Wed, 21 Apr 2021 14:39:27 +0800
Subject: [PATCH 1/2] drm/amdgpu: add support for ras init flags

conditionally configure ras for dgpu mode or poison propogation mode

Signed-off-by: John Clements <john.clements@amd.com>
Change-Id: Id9e3fc386f6f6d7bdacae2de2cd5360b017e9996
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++++--
 drivers/gpu/drm/amd/amdgpu/ta_ras_if.h  | 7 +++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index a09483beb968..9311dcc94cb6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1037,6 +1037,13 @@ static int psp_ras_load(struct psp_context *psp)
 	memset(psp->fw_pri_buf, 0, PSP_1_MEG);
 	memcpy(psp->fw_pri_buf, psp->ta_ras_start_addr, psp->ta_ras_ucode_size);
 
+	ras_cmd = (struct ta_ras_shared_memory *)psp->ras.ras_shared_buf;
+
+	if (psp->adev->gmc.xgmi.connected_to_cpu)
+		ras_cmd->ras_in_message.init_flags.poison_mode_en = 1;
+	else
+		ras_cmd->ras_in_message.init_flags.dgpu_mode = 1;
+
 	psp_prep_ta_load_cmd_buf(cmd,
 				 psp->fw_pri_mc_addr,
 				 psp->ta_ras_ucode_size,
@@ -1046,8 +1053,6 @@ static int psp_ras_load(struct psp_context *psp)
 	ret = psp_cmd_submit_buf(psp, NULL, cmd,
 			psp->fence_buf_mc_addr);
 
-	ras_cmd = (struct ta_ras_shared_memory *)psp->ras.ras_shared_buf;
-
 	if (!ret) {
 		psp->ras.session_id = cmd->resp.session_id;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/ta_ras_if.h b/drivers/gpu/drm/amd/amdgpu/ta_ras_if.h
index 745ed0fba1ed..0f214a398dd8 100644
--- a/drivers/gpu/drm/amd/amdgpu/ta_ras_if.h
+++ b/drivers/gpu/drm/amd/amdgpu/ta_ras_if.h
@@ -105,6 +105,12 @@ struct ta_ras_trigger_error_input {
 	uint64_t		value;			// method if error injection. i.e persistent, coherent etc.
 };
 
+struct ta_ras_init_flags
+{
+    uint8_t     poison_mode_en;
+    uint8_t     dgpu_mode;
+};
+
 struct ta_ras_output_flags
 {
 	uint8_t    ras_init_success_flag;
@@ -115,6 +121,7 @@ struct ta_ras_output_flags
 /* Common input structure for RAS callbacks */
 /**********************************************************/
 union ta_ras_cmd_input {
+	struct ta_ras_init_flags		init_flags;
 	struct ta_ras_enable_features_input	enable_features;
 	struct ta_ras_disable_features_input	disable_features;
 	struct ta_ras_trigger_error_input	trigger_error;
-- 
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: add support for ras init flags
  2021-04-21  6:56 [PATCH] drm/amdgpu: add support for ras init flags Clements, John
@ 2021-04-21  7:00 ` Zhang, Hawking
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Hawking @ 2021-04-21  7:00 UTC (permalink / raw)
  To: Clements, John, amd-gfx


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

[AMD Public Use]

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

Regards,
Hawking
From: Clements, John <John.Clements@amd.com>
Sent: Wednesday, April 21, 2021 14:57
To: amd-gfx@lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH] drm/amdgpu: add support for ras init flags


[AMD Official Use Only - Internal Distribution Only]

Submitting patch to select RAS dGPU mode/poison propagation mode

[-- Attachment #1.2: Type: text/html, Size: 3270 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:[~2021-04-21  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  6:56 [PATCH] drm/amdgpu: add support for ras init flags Clements, John
2021-04-21  7:00 ` Zhang, Hawking

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).