drm/amdgpu: Fix API status offset for MES queue reset
authorJesse.Zhang <Jesse.Zhang@amd.com>
Mon, 28 Apr 2025 02:35:19 +0000 (10:35 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Apr 2025 22:10:06 +0000 (18:10 -0400)
The mes_v11_0_reset_hw_queue and mes_v12_0_reset_hw_queue functions were
using the wrong union type (MESAPI__REMOVE_QUEUE) when getting the offset
for api_status. Since these functions handle queue reset operations, they
should use MESAPI__RESET union instead.

This fixes the polling of API status during hardware queue reset operations
in the MES for both v11 and v12 versions.

Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reviewed-By: Shaoyun.liu <Shaoyun.liu@amd.com>
Reviewed-by: Prike Liang <Prike.Liang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

index 0a5b7a296f08d3e55c5470fc0eb35a22d9e5fd6c..b34d7bedc3176a4913e8b47f9695299e223013cd 100644 (file)
@@ -497,7 +497,7 @@ static int mes_v11_0_reset_hw_queue(struct amdgpu_mes *mes,
 
        return mes_v11_0_submit_pkt_and_poll_completion(mes,
                        &mes_reset_queue_pkt, sizeof(mes_reset_queue_pkt),
-                       offsetof(union MESAPI__REMOVE_QUEUE, api_status));
+                       offsetof(union MESAPI__RESET, api_status));
 }
 
 static int mes_v11_0_map_legacy_queue(struct amdgpu_mes *mes,
index 1f7614dccb005029c94e02dd1b1d60097edda914..ee8b531b713d6dba5b33a536aab3429935e8a0d3 100644 (file)
@@ -517,7 +517,7 @@ static int mes_v12_0_reset_hw_queue(struct amdgpu_mes *mes,
 
        return mes_v12_0_submit_pkt_and_poll_completion(mes, pipe,
                        &mes_reset_queue_pkt, sizeof(mes_reset_queue_pkt),
-                       offsetof(union MESAPI__REMOVE_QUEUE, api_status));
+                       offsetof(union MESAPI__RESET, api_status));
 }
 
 static int mes_v12_0_map_legacy_queue(struct amdgpu_mes *mes,