]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: fix gfx12 mes packet status return check
authorJonathan Kim <jonathan.kim@amd.com>
Thu, 9 Oct 2025 14:45:42 +0000 (10:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Oct 2025 18:14:16 +0000 (14:14 -0400)
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.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

index aff06f06aeeecf2203274e75286223d041616e32..e3149196143e7d15423e497fe27faf4dcaab293a 100644 (file)
@@ -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",