drm/sched: Warn if pending_list is not empty

drm_sched_fini() can leak jobs under certain circumstances.

Warn if that happens.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250710125412.128476-7-phasta@kernel.org
This commit is contained in:
Philipp Stanner 2025-07-10 14:54:09 +02:00
parent c2668a0e03
commit d1e5ba835f

View File

@ -1414,6 +1414,9 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched)
sched->ready = false;
kfree(sched->sched_rq);
sched->sched_rq = NULL;
if (!list_empty(&sched->pending_list))
dev_warn(sched->dev, "Tearing down scheduler while jobs are pending!\n");
}
EXPORT_SYMBOL(drm_sched_fini);