Skip to content

Commit 704d3d6

Browse files
committed
drm/etnaviv: don't block scheduler when GPU is still active
Since 45ecaea ("drm/sched: Partial revert of 'drm/sched: Keep s_fence->parent pointer'") still active jobs aren't put back in the pending list on drm_sched_start(), as they don't have a active parent fence anymore, so if the GPU is still working and the timeout is extended, all currently active jobs will be freed. To avoid prematurely freeing jobs that are still active on the GPU, don't block the scheduler until we are fully committed to actually reset the GPU. As the current job is already removed from the pending list and will not be put back when drm_sched_start() isn't called, we must make sure to put the job back on the pending list when extending the timeout. Cc: [email protected] #6.0 Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
1 parent beb311f commit 704d3d6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/gpu/drm/etnaviv/etnaviv_sched.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
3838
u32 dma_addr;
3939
int change;
4040

41-
/* block scheduler */
42-
drm_sched_stop(&gpu->sched, sched_job);
43-
4441
/*
4542
* If the GPU managed to complete this jobs fence, the timout is
4643
* spurious. Bail out.
@@ -63,6 +60,9 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
6360
goto out_no_timeout;
6461
}
6562

63+
/* block scheduler */
64+
drm_sched_stop(&gpu->sched, sched_job);
65+
6666
if(sched_job)
6767
drm_sched_increase_karma(sched_job);
6868

@@ -76,8 +76,7 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
7676
return DRM_GPU_SCHED_STAT_NOMINAL;
7777

7878
out_no_timeout:
79-
/* restart scheduler after GPU is usable again */
80-
drm_sched_start(&gpu->sched, true);
79+
list_add(&sched_job->list, &sched_job->sched->pending_list);
8180
return DRM_GPU_SCHED_STAT_NOMINAL;
8281
}
8382

0 commit comments

Comments
 (0)