drm/amdgpu: Update ring scheduler info as needed
authorLijo Lazar <lijo.lazar@amd.com>
Tue, 18 Jul 2023 12:11:45 +0000 (17:41 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jul 2023 17:39:29 +0000 (13:39 -0400)
Not all rings have scheduler associated. Only update scheduler data for
rings with scheduler. It could result in out of bound access as total
rings are more than those associated with particular IPs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c

index 72b629a..d0fc627 100644 (file)
@@ -134,7 +134,7 @@ static int aqua_vanjaram_xcp_sched_list_update(
 
        for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
                ring = adev->rings[i];
-               if (!ring || !ring->sched.ready)
+               if (!ring || !ring->sched.ready || ring->no_scheduler)
                        continue;
 
                aqua_vanjaram_xcp_gpu_sched_update(adev, ring, ring->xcp_id);