Skip to content

Commit 4700fd3

Browse files
committed
drm/panthor: Report group as timedout when we fail to properly suspend
If we don't do that, the group is considered usable by userspace, but all further GROUP_SUBMIT will fail with -EINVAL. Changes in v3: - Add R-bs Changes in v2: - New patch Fixes: de85488 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 412a2a8 commit 4700fd3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/panthor/panthor_sched.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,11 @@ struct panthor_group {
589589
* @timedout: True when a timeout occurred on any of the queues owned by
590590
* this group.
591591
*
592-
* Timeouts can be reported by drm_sched or by the FW. In any case, any
593-
* timeout situation is unrecoverable, and the group becomes useless.
594-
* We simply wait for all references to be dropped so we can release the
595-
* group object.
592+
* Timeouts can be reported by drm_sched or by the FW. If a reset is required,
593+
* and the group can't be suspended, this also leads to a timeout. In any case,
594+
* any timeout situation is unrecoverable, and the group becomes useless. We
595+
* simply wait for all references to be dropped so we can release the group
596+
* object.
596597
*/
597598
bool timedout;
598599

@@ -2640,6 +2641,12 @@ void panthor_sched_suspend(struct panthor_device *ptdev)
26402641
csgs_upd_ctx_init(&upd_ctx);
26412642
while (slot_mask) {
26422643
u32 csg_id = ffs(slot_mask) - 1;
2644+
struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id];
2645+
2646+
/* We consider group suspension failures as fatal and flag the
2647+
* group as unusable by setting timedout=true.
2648+
*/
2649+
csg_slot->group->timedout = true;
26432650

26442651
csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id,
26452652
CSG_STATE_TERMINATE,

0 commit comments

Comments
 (0)