Skip to content

Commit 2dd415c

Browse files
lynxeye-devgregkh
authored andcommitted
drm/etnaviv: don't block scheduler when GPU is still active
commit 704d3d6 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c69a4c0 commit 2dd415c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/gpu/drm/etnaviv/etnaviv_sched.c

+4-5
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.
@@ -62,6 +59,9 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
6259
goto out_no_timeout;
6360
}
6461

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

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

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

0 commit comments

Comments
 (0)