]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/panthor: Extend IRQ helpers for mask modification/restoration
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Fri, 16 Jan 2026 12:57:31 +0000 (13:57 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 22 Jan 2026 14:13:43 +0000 (15:13 +0100)
commitc5bf1d4e4473f0f18dfba0266a8fd48cb3700e73
tree6674b3c7e78b061e6fbd7a1707c3587de3e0c1c3
parent0b2d86670a8438f6e98266a86ab5f407c6e2b0b6
drm/panthor: Extend IRQ helpers for mask modification/restoration

The current IRQ helpers do not guarantee mutual exclusion that covers
the entire transaction from accessing the mask member and modifying the
mask register.

This makes it hard, if not impossible, to implement mask modification
helpers that may change one of these outside the normal
suspend/resume/isr code paths.

Add a spinlock to struct panthor_irq that protects both the mask member
and register. Acquire it in all code paths that access these, but drop
it before processing the threaded handler function. Then, add the
aforementioned new helpers: enable_events, and disable_events. They work
by ORing and NANDing the mask bits.

resume is changed to no longer have a mask passed, as pirq->mask is
supposed to be the user-requested mask now, rather than a mirror of the
INT_MASK register contents. Users of the resume helper are adjusted
accordingly, including a rather painful refactor in panthor_mmu.c.

In panthor_mmu.c, the bespoke mask modification is excised, and replaced
with enable_events/disable_events in as_enable/as_disable.

Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20260116-panthor-tracepoints-v10-2-d925986e3d1b@collabora.com
drivers/gpu/drm/panthor/panthor_device.h
drivers/gpu/drm/panthor/panthor_fw.c
drivers/gpu/drm/panthor/panthor_gpu.c
drivers/gpu/drm/panthor/panthor_mmu.c
drivers/gpu/drm/panthor/panthor_pwr.c