Skip to content

Commit 1de434e

Browse files
committed
drm/panthor: Fix ordering in _irq_suspend()
Make sure we set suspended=true last to avoid generating an irq storm in the unlikely case where an IRQ happens between the suspended=true assignment and the _INT_MASK update. We also move the mask=0 assignment before writing to the _INT_MASK register to prevent the thread handler from unmasking the interrupt behind our back. This means we might lose events if there were some pending when we get to suspend the IRQ, but that's fine. The synchronize_irq() we have in the _irq_suspend() path was not there to make sure all IRQs are processed, just to make sure we don't have registers accesses coming from the irq handlers after _irq_suspend() has been called. If there's a need to have all pending IRQs processed, it should happen before _irq_suspend() is called. v3: - Add Steve's R-b v2: - New patch Fixes: 5fe909c ("drm/panthor: Add the device logical block") Reported-by: Steven Price <steven.price@arm.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240326111205.510019-2-boris.brezillon@collabora.com
1 parent 11f0275 commit 1de434e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/panthor/panthor_device.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq)
325325
{ \
326326
int cookie; \
327327
\
328-
atomic_set(&pirq->suspended, true); \
328+
pirq->mask = 0; \
329329
\
330330
if (drm_dev_enter(&pirq->ptdev->base, &cookie)) { \
331331
gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0); \
332332
synchronize_irq(pirq->irq); \
333333
drm_dev_exit(cookie); \
334334
} \
335335
\
336-
pirq->mask = 0; \
336+
atomic_set(&pirq->suspended, true); \
337337
} \
338338
\
339339
static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u32 mask) \

0 commit comments

Comments
 (0)