Commit 3b5ac97a authored by Boris Brezillon's avatar Boris Brezillon
Browse files

drm/sched: Declare entity idle only after HW submission



The panfrost driver tries to kill in-flight jobs on FD close after
destroying the FD scheduler entities. For this to work properly, we
need to make sure the jobs popped from the scheduler entities have
been queued at the HW level before declaring the entity idle, otherwise
we might iterate over a list that doesn't contain those jobs.

Suggested-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Reviewed-by: default avatarLucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210624140850.2229697-1-boris.brezillon@collabora.com
parent 71501859
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -802,10 +802,10 @@ static int drm_sched_main(void *param)

		sched_job = drm_sched_entity_pop_job(entity);

		if (!sched_job) {
			complete(&entity->entity_idle);

		if (!sched_job)
			continue;
		}

		s_fence = sched_job->s_fence;

@@ -814,6 +814,7 @@ static int drm_sched_main(void *param)

		trace_drm_run_job(sched_job, entity);
		fence = sched->ops->run_job(sched_job);
		complete(&entity->entity_idle);
		drm_sched_fence_scheduled(s_fence);

		if (!IS_ERR_OR_NULL(fence)) {