Skip to content

Commit 8902c2b

Browse files
committed
drm/etnaviv: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
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>
1 parent 6b37fba commit 8902c2b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

drivers/gpu/drm/etnaviv/etnaviv_sched.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
4040
int change;
4141

4242
/*
43-
* If the GPU managed to complete this jobs fence, the timout is
44-
* spurious. Bail out.
43+
* If the GPU managed to complete this jobs fence, the timeout has
44+
* fired before free-job worker. The timeout is spurious, so bail out.
4545
*/
4646
if (dma_fence_is_signaled(submit->out_fence))
47-
goto out_no_timeout;
47+
return DRM_GPU_SCHED_STAT_NO_HANG;
4848

4949
/*
5050
* 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
7070
gpu->hangcheck_dma_addr = dma_addr;
7171
gpu->hangcheck_primid = primid;
7272
gpu->hangcheck_fence = gpu->completed_fence;
73-
goto out_no_timeout;
73+
return DRM_GPU_SCHED_STAT_NO_HANG;
7474
}
7575

7676
/* block scheduler */
@@ -87,10 +87,6 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
8787

8888
drm_sched_start(&gpu->sched, 0);
8989
return DRM_GPU_SCHED_STAT_RESET;
90-
91-
out_no_timeout:
92-
list_add(&sched_job->list, &sched_job->sched->pending_list);
93-
return DRM_GPU_SCHED_STAT_RESET;
9490
}
9591

9692
static void etnaviv_sched_free_job(struct drm_sched_job *sched_job)

0 commit comments

Comments
 (0)