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

Configure Feed

Select the types of activity you want to include in your feed.

drm/panthor: Reset queue slots if termination fails

Make sure the queue slot is reset even if we failed termination so
we don't have garbage in the CS input interface after a reset. In
practice that's not a problem because we zero out all RW sections when
a hangs occurs, but it's safer to reset things manually, in case we
decide to not conditionally reload RW sections based on the type of
hang.

v4:
- Split the changes in two separate patches

v5:
- No changes

v6:
- Adjust the explanation in the commit message
- Drop the Fixes tag
- Put after the timeout changes and make the two patches independent
so one can be backported, and the other not

v7:
- Use the local group variable instead of dereferencing csg_slot->group
- Add Steve's R-b

v8:
- No changes

Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20251113105734.1520338-3-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

authored by

Ashley Smith and committed by
Boris Brezillon
6f53bcb4 345c5b7c

+12 -2
+12 -2
drivers/gpu/drm/panthor/panthor_sched.c
··· 2841 2841 while (slot_mask) { 2842 2842 u32 csg_id = ffs(slot_mask) - 1; 2843 2843 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; 2844 + struct panthor_group *group = csg_slot->group; 2844 2845 2845 2846 /* Terminate command timedout, but the soft-reset will 2846 2847 * automatically terminate all active groups, so let's 2847 2848 * force the state to halted here. 2848 2849 */ 2849 - if (csg_slot->group->state != PANTHOR_CS_GROUP_TERMINATED) 2850 - csg_slot->group->state = PANTHOR_CS_GROUP_TERMINATED; 2850 + if (group->state != PANTHOR_CS_GROUP_TERMINATED) { 2851 + group->state = PANTHOR_CS_GROUP_TERMINATED; 2852 + 2853 + /* Reset the queue slots manually if the termination 2854 + * request failed. 2855 + */ 2856 + for (i = 0; i < group->queue_count; i++) { 2857 + if (group->queues[i]) 2858 + cs_slot_reset_locked(ptdev, csg_id, i); 2859 + } 2860 + } 2851 2861 slot_mask &= ~BIT(csg_id); 2852 2862 } 2853 2863 }