]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/panthor: Don't declare a queue blocked if deferred operations are pending
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Sep 2024 07:19:14 +0000 (09:19 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 1 Oct 2024 16:40:29 +0000 (18:40 +0200)
If deferred operations are pending, we want to wait for those to
land before declaring the queue blocked on a SYNC_WAIT. We need
this to deal with the case where the sync object is signalled through
a deferred SYNC_{ADD,SET} from the same queue. If we don't do that
and the group gets scheduled out before the deferred SYNC_{SET,ADD}
is executed, we'll end up with a timeout, because no external
SYNC_{SET,ADD} will make the scheduler reconsider the group for
execution.

Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240905071914.3278599-1-boris.brezillon@collabora.com
drivers/gpu/drm/panthor/panthor_sched.c

index 145d983bb129e7c8e3f0bd8de6f5f9f8e79b0353..2aff02ba6949002b8c88f02b3c97aec4609d2ebe 100644 (file)
@@ -1103,7 +1103,13 @@ cs_slot_sync_queue_state_locked(struct panthor_device *ptdev, u32 csg_id, u32 cs
                        list_move_tail(&group->wait_node,
                                       &group->ptdev->scheduler->groups.waiting);
                }
-               group->blocked_queues |= BIT(cs_id);
+
+               /* The queue is only blocked if there's no deferred operation
+                * pending, which can be checked through the scoreboard status.
+                */
+               if (!cs_iface->output->status_scoreboards)
+                       group->blocked_queues |= BIT(cs_id);
+
                queue->syncwait.gpu_va = cs_iface->output->status_wait_sync_ptr;
                queue->syncwait.ref = cs_iface->output->status_wait_sync_value;
                status_wait_cond = cs_iface->output->status_wait & CS_STATUS_WAIT_SYNC_COND_MASK;