drm/amdkfd: Fix MEC pipe interrupt enablement
authorLijo Lazar <lijo.lazar@amd.com>
Mon, 29 May 2023 13:48:54 +0000 (19:18 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 16:31:35 +0000 (12:31 -0400)
for_each_inst modifies xcc_mask and therefore the loop doesn't
initialize properly interrupts on all pipes. Keep looping through xcc as
the outer loop to fix this issue.

Fixes: c4050ff1a43e ("drm/amdkfd: Use xcc mask for identifying xcc")
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index 493b4b6..80cddb4 100644 (file)
@@ -1274,11 +1274,12 @@ static void init_interrupts(struct device_queue_manager *dqm)
        uint32_t xcc_mask = dqm->dev->xcc_mask;
        unsigned int i, xcc_id;
 
-       for (i = 0 ; i < get_pipes_per_mec(dqm) ; i++) {
-               if (is_pipe_enabled(dqm, 0, i)) {
-                       for_each_inst(xcc_id, xcc_mask)
+       for_each_inst(xcc_id, xcc_mask) {
+               for (i = 0 ; i < get_pipes_per_mec(dqm) ; i++) {
+                       if (is_pipe_enabled(dqm, 0, i)) {
                                dqm->dev->kfd2kgd->init_interrupts(
                                        dqm->dev->adev, i, xcc_id);
+                       }
                }
        }
 }