mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-08 12:02:33 +02:00
drm/panthor: Defer scheduler entitiy destruction to queue release
[ Upstream commit7d9c3442b0] Commitde85488138("drm/panthor: Add the scheduler logical block") handled destruction of a group's queues' drm scheduler entities early into the group destruction procedure. However, that races with the group submit ioctl, because by the time entities are destroyed (through the group destroy ioctl), the submission procedure might've already obtained a group handle, and therefore the ability to push jobs into entities. This is met with a DRM error message within the drm scheduler core as a situation that should never occur. Fix by deferring drm scheduler entity destruction to queue release time. Fixes:de85488138("drm/panthor: Add the scheduler logical block") Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://lore.kernel.org/r/20250919164436.531930-1-adrian.larumbe@collabora.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a170b9c0dd
commit
894e005a01
@@ -865,8 +865,7 @@ static void group_free_queue(struct panthor_group *group, struct panthor_queue *
|
||||
if (IS_ERR_OR_NULL(queue))
|
||||
return;
|
||||
|
||||
if (queue->entity.fence_context)
|
||||
drm_sched_entity_destroy(&queue->entity);
|
||||
drm_sched_entity_destroy(&queue->entity);
|
||||
|
||||
if (queue->scheduler.ops)
|
||||
drm_sched_fini(&queue->scheduler);
|
||||
@@ -3458,11 +3457,6 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle)
|
||||
if (!group)
|
||||
return -EINVAL;
|
||||
|
||||
for (u32 i = 0; i < group->queue_count; i++) {
|
||||
if (group->queues[i])
|
||||
drm_sched_entity_destroy(&group->queues[i]->entity);
|
||||
}
|
||||
|
||||
mutex_lock(&sched->reset.lock);
|
||||
mutex_lock(&sched->lock);
|
||||
group->destroyed = true;
|
||||
|
||||
Reference in New Issue
Block a user