Skip to content

Commit 7d9c344

Browse files
larunbeSteven Price
authored andcommitted
drm/panthor: Defer scheduler entitiy destruction to queue release
Commit de85488 ("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: de85488 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Adrián Larumbe <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9b2f5ef commit 7d9c344

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/gpu/drm/panthor/panthor_sched.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,7 @@ static void group_free_queue(struct panthor_group *group, struct panthor_queue *
886886
if (IS_ERR_OR_NULL(queue))
887887
return;
888888

889-
if (queue->entity.fence_context)
890-
drm_sched_entity_destroy(&queue->entity);
889+
drm_sched_entity_destroy(&queue->entity);
891890

892891
if (queue->scheduler.ops)
893892
drm_sched_fini(&queue->scheduler);
@@ -3558,11 +3557,6 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle)
35583557
if (!group)
35593558
return -EINVAL;
35603559

3561-
for (u32 i = 0; i < group->queue_count; i++) {
3562-
if (group->queues[i])
3563-
drm_sched_entity_destroy(&group->queues[i]->entity);
3564-
}
3565-
35663560
mutex_lock(&sched->reset.lock);
35673561
mutex_lock(&sched->lock);
35683562
group->destroyed = true;

0 commit comments

Comments
 (0)