AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: fix gfx12 mes packet status return check
@ 2025-10-10 16:33 Jonathan Kim
  2025-10-10 16:33 ` [PATCH 2/3] drm/amdgpu: fix hung reset queue array memory allocation Jonathan Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan Kim @ 2025-10-10 16:33 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, alexdeucher, Jonathan Kim

GFX12 MES uses low 32 bits of status return for success (1 or 0)
and high bits for debug information if low bits are 0.

GFX11 MES doesn't do this so checking full 64-bit status return
for 1 or 0 is still valid.

v2: user lower_32_bits to check status and write some inline comments to
explain the status pointer value.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index aff06f06aeee..e3149196143e 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -228,7 +228,12 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
 			pipe, x_pkt->header.opcode);
 
 	r = amdgpu_fence_wait_polling(ring, seq, timeout);
-	if (r < 1 || !*status_ptr) {
+
+	/*
+	 * status_ptr[31:0] == 0 (fail) or status_ptr[63:0] == 1 (success).
+	 * If status_ptr[31:0] == 0 then status_ptr[63:32] will have debug error information.
+	 */
+	if (r < 1 || !(lower_32_bits(*status_ptr))) {
 
 		if (misc_op_str)
 			dev_err(adev->dev, "MES(%d) failed to respond to msg=%s (%s)\n",
-- 
2.34.1


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

end of thread, other threads:[~2025-10-10 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10 16:33 [PATCH 1/3] drm/amdgpu: fix gfx12 mes packet status return check Jonathan Kim
2025-10-10 16:33 ` [PATCH 2/3] drm/amdgpu: fix hung reset queue array memory allocation Jonathan Kim
2025-10-10 16:33 ` [PATCH 3/3] drm/amdgpu: update remove after reset flag for MES remove queue Jonathan Kim
2025-10-10 17:28 ` [PATCH 1/3] drm/amdgpu: fix gfx12 mes packet status return check Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox