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>
        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);
+                       }
                }
        }
 }