Etnaviv can skip a hardware reset in two situations:

  1. TDR has fired before the IRQ 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 relying on the scheduler internals, use the
DRM_GPU_SCHED_STAT_RUNNING status to skip the reset and rearm the timer.

Signed-off-by: Maíra Canal <mca...@igalia.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_sched.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c 
b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
index 
76a3a3e517d8d9f654fb6b9e98e72910795cfc7a..b87ffdb4136aebade736d78b3677de2f21d52ebc
 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
@@ -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, TDR has fired before
+        * IRQ and the timeout is spurious. Bail out.
         */
        if (dma_fence_is_signaled(submit->out_fence))
-               goto out_no_timeout;
+               return DRM_GPU_SCHED_STAT_RUNNING;
 
        /*
         * 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_RUNNING;
        }
 
        /* 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_NOMINAL;
-
-out_no_timeout:
-       list_add(&sched_job->list, &sched_job->sched->pending_list);
-       return DRM_GPU_SCHED_STAT_NOMINAL;
 }
 
 static void etnaviv_sched_free_job(struct drm_sched_job *sched_job)

-- 
2.49.0

Reply via email to