]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/imagination: Don't timeout job if its fence has been signaled
authorBrajesh Gupta <brajesh.gupta@imgtec.com>
Tue, 19 May 2026 08:25:27 +0000 (13:55 +0530)
committerMatt Coster <matt.coster@imgtec.com>
Tue, 19 May 2026 11:40:15 +0000 (12:40 +0100)
Verify the job’s fence in the timeout handler; if the firmware has since
signaled completion, then report NO HANG.

Signed-off-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Link: https://patch.msgid.link/20260519-b4-context_reset-v2-2-931018a7131d@imgtec.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
drivers/gpu/drm/imagination/pvr_queue.c

index d10a13173f0ff3fc81951b8805ffb1e39dd25beb..822e6259674f37777e9d53ecd9a20d6c9c7f5c21 100644 (file)
@@ -851,7 +851,9 @@ static void pvr_queue_start(struct pvr_queue *queue)
  * the scheduler, and re-assign parent fences in the middle.
  *
  * Return:
- *  * DRM_GPU_SCHED_STAT_RESET.
+ *  *%DRM_GPU_SCHED_STAT_NO_HANG if the job fence has already been
+ *   signaled, or
+ *  *%DRM_GPU_SCHED_STAT_RESET otherwise.
  */
 static enum drm_gpu_sched_stat
 pvr_queue_timedout_job(struct drm_sched_job *s_job)
@@ -862,6 +864,9 @@ pvr_queue_timedout_job(struct drm_sched_job *s_job)
        struct pvr_job *job;
        u32 job_count = 0;
 
+       if (dma_fence_is_signaled(s_job->s_fence->parent))
+               return DRM_GPU_SCHED_STAT_NO_HANG;
+
        dev_err(sched->dev, "Job timeout\n");
 
        /* Before we stop the scheduler, make sure the queue is out of any list, so