]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Oct 2025 14:20:22 +0000 (16:20 +0200)
commit d0de79f66a80eeb849033fae34bd07a69ce72235 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

index e3f4f5fbbd6e75fbd68f2e4d851e826ed605cc68..19cbf80fa32144be522223689dc81f26bf457e3f 100644 (file)
@@ -224,7 +224,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",