Skip to content

Commit 6b37fba

Browse files
committed
drm/v3d: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
When a CL/CSD job times out, we check if the GPU has made any progress since the last timeout. If so, instead of resetting the hardware, we skip the reset and allow the timer to be rearmed. This gives long-running jobs 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: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-5-5c5ba4f55039@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
1 parent 1472e75 commit 6b37fba

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

drivers/gpu/drm/v3d/v3d_sched.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -744,16 +744,6 @@ v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job)
744744
return DRM_GPU_SCHED_STAT_RESET;
745745
}
746746

747-
static void
748-
v3d_sched_skip_reset(struct drm_sched_job *sched_job)
749-
{
750-
struct drm_gpu_scheduler *sched = sched_job->sched;
751-
752-
spin_lock(&sched->job_list_lock);
753-
list_add(&sched_job->list, &sched->pending_list);
754-
spin_unlock(&sched->job_list_lock);
755-
}
756-
757747
static enum drm_gpu_sched_stat
758748
v3d_cl_job_timedout(struct drm_sched_job *sched_job, enum v3d_queue q,
759749
u32 *timedout_ctca, u32 *timedout_ctra)
@@ -772,8 +762,7 @@ v3d_cl_job_timedout(struct drm_sched_job *sched_job, enum v3d_queue q,
772762
*timedout_ctca = ctca;
773763
*timedout_ctra = ctra;
774764

775-
v3d_sched_skip_reset(sched_job);
776-
return DRM_GPU_SCHED_STAT_RESET;
765+
return DRM_GPU_SCHED_STAT_NO_HANG;
777766
}
778767

779768
return v3d_gpu_reset_for_timeout(v3d, sched_job);
@@ -818,8 +807,7 @@ v3d_csd_job_timedout(struct drm_sched_job *sched_job)
818807
if (job->timedout_batches != batches) {
819808
job->timedout_batches = batches;
820809

821-
v3d_sched_skip_reset(sched_job);
822-
return DRM_GPU_SCHED_STAT_RESET;
810+
return DRM_GPU_SCHED_STAT_NO_HANG;
823811
}
824812

825813
return v3d_gpu_reset_for_timeout(v3d, sched_job);

0 commit comments

Comments
 (0)