]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/etnaviv: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
authorMaíra Canal <mcanal@igalia.com>
Mon, 14 Jul 2025 22:07:07 +0000 (19:07 -0300)
committerMaíra Canal <mcanal@igalia.com>
Tue, 15 Jul 2025 11:27:08 +0000 (08:27 -0300)
Etnaviv can skip a hardware reset in two situations:

  1. TDR has fired before the free-job worker and the timeout is spurious.
  2. The GPU is still making progress on the front-end and we can give
     the job a chance to complete.

Instead of manipulating scheduler's internals, inform the scheduler that
the job did not actually timeout and no reset was performed through
the new status code DRM_GPU_SCHED_STAT_NO_HANG.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-6-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
drivers/gpu/drm/etnaviv/etnaviv_sched.c

index 7146069a98492f5fab2a49d96e2054f649e1fe3d..df4232d7e135d11e0fc9fc456a2a2b0070c7f548 100644 (file)
@@ -40,11 +40,11 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
        int change;
 
        /*
-        * If the GPU managed to complete this jobs fence, the timout is
-        * spurious. Bail out.
+        * If the GPU managed to complete this jobs fence, the timeout has
+        * fired before free-job worker. The timeout is spurious, so bail out.
         */
        if (dma_fence_is_signaled(submit->out_fence))
-               goto out_no_timeout;
+               return DRM_GPU_SCHED_STAT_NO_HANG;
 
        /*
         * If the GPU is still making forward progress on the front-end (which
@@ -70,7 +70,7 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
                gpu->hangcheck_dma_addr = dma_addr;
                gpu->hangcheck_primid = primid;
                gpu->hangcheck_fence = gpu->completed_fence;
-               goto out_no_timeout;
+               return DRM_GPU_SCHED_STAT_NO_HANG;
        }
 
        /* block scheduler */
@@ -87,10 +87,6 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
 
        drm_sched_start(&gpu->sched, 0);
        return DRM_GPU_SCHED_STAT_RESET;
-
-out_no_timeout:
-       list_add(&sched_job->list, &sched_job->sched->pending_list);
-       return DRM_GPU_SCHED_STAT_RESET;
 }
 
 static void etnaviv_sched_free_job(struct drm_sched_job *sched_job)