]> git.hungrycats.org Git - linux/commitdiff
drm/amdgpu/mes_v12_1: use mes schedule pipe for legacy queues on unified MES
authorJesse Zhang <Jesse.Zhang@amd.com>
Mon, 30 Mar 2026 01:33:28 +0000 (09:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jun 2026 19:51:33 +0000 (15:51 -0400)
when suspend_all_gangs is issued to pipe0 MES during system suspend or runtime PM, pipe0 can only suspend and resume queues it has tracked.
KCQs registered with a non-zero pipe slot may not be correctly handled, leaving them in an inconsistent state after resume.

v3: fix the schedule pipe issue

Suggested-by: Michael Chen <michael.chen@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Shaoyun Liu <shaoyun.liu@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@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_v12_1.c

index 8a90ad5a51b8b5f402a6339c1a4c053cea83e1aa..8007a6e69305515ade4607743465481af7d64c77 100644 (file)
@@ -417,10 +417,15 @@ static int mes_v12_1_map_legacy_queue(struct amdgpu_mes *mes,
                convert_to_mes_queue_type(input->queue_type);
        mes_add_queue_pkt.map_legacy_kq = 1;
 
-       if (mes->adev->enable_uni_mes)
-               pipe = AMDGPU_MES_KIQ_PIPE;
-       else
+       if (mes->adev->enable_uni_mes) {
+               /* Keep scheduler queue on KIQ pipe; map all other kernel queues on sched pipe. */
+               if (input->queue_type == AMDGPU_RING_TYPE_MES)
+                       pipe = AMDGPU_MES_KIQ_PIPE;
+               else
+                       pipe = AMDGPU_MES_SCHED_PIPE;
+       } else {
                pipe = AMDGPU_MES_SCHED_PIPE;
+       }
 
        return mes_v12_1_submit_pkt_and_poll_completion(mes,
                        input->xcc_id, pipe,
@@ -457,10 +462,15 @@ static int mes_v12_1_unmap_legacy_queue(struct amdgpu_mes *mes,
                        convert_to_mes_queue_type(input->queue_type);
        }
 
-       if (mes->adev->enable_uni_mes)
-               pipe = AMDGPU_MES_KIQ_PIPE;
-       else
+       if (mes->adev->enable_uni_mes) {
+               /* Keep scheduler queue on KIQ pipe; map all other kernel queues on sched pipe. */
+               if (input->queue_type == AMDGPU_RING_TYPE_MES)
+                       pipe = AMDGPU_MES_KIQ_PIPE;
+               else
+                       pipe = AMDGPU_MES_SCHED_PIPE;
+       } else {
                pipe = AMDGPU_MES_SCHED_PIPE;
+       }
 
        return mes_v12_1_submit_pkt_and_poll_completion(mes,
                        input->xcc_id, pipe,