Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: de8548813824 ("drm/panthor: Add the scheduler logical block")
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/20241029152912.270346-3-boris.brezillon@collabora.com

+11 -4
+11 -4
drivers/gpu/drm/panthor/panthor_sched.c
··· 589 589 * @timedout: True when a timeout occurred on any of the queues owned by 590 590 * this group. 591 591 * 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. 596 597 */ 597 598 bool timedout; 598 599 ··· 2641 2640 csgs_upd_ctx_init(&upd_ctx); 2642 2641 while (slot_mask) { 2643 2642 u32 csg_id = ffs(slot_mask) - 1; 2643 + struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; 2644 + 2645 + /* We consider group suspension failures as fatal and flag the 2646 + * group as unusable by setting timedout=true. 2647 + */ 2648 + csg_slot->group->timedout = true; 2644 2649 2645 2650 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, 2646 2651 CSG_STATE_TERMINATE,