There are two problems in panthor's cache flushing/soft reset code related to locking.
The first problem is that the spinlocks are taken with _irqsave, even though the contended lock is never acquired in a raw interrupt handler. Only a threaded handler locks it. The second problem is that the wait_event condition references pending_reqs without holding the required lock. This means there's a data race. While resolving the first problem is easy, the second problem requires adding some more macro variants to wait.h, which is done in the first patch. New tracepoints to debug cache flushing duration without initial locking waits is thrown in for good measure as well, to complement what's in lock_stat and what the function tracer can already do. Signed-off-by: Nicolas Frattaroli <[email protected]> --- Nicolas Frattaroli (3): wait: Introduce non-irq variants of wait_event_lock_timeout drm/panthor: Revisit reqs_lock handling in flush/reset paths drm/panthor: Add tracepoints for cache flushing drivers/gpu/drm/panthor/panthor_gpu.c | 28 +++++------ drivers/gpu/drm/panthor/panthor_trace.h | 58 +++++++++++++++++++++++ include/linux/wait.h | 84 +++++++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+), 14 deletions(-) --- base-commit: f57436380d5de1c1ded898e21378b0b4159c8790 change-id: 20260728-panthor-cache-flush-fix-b36cb15f92c3 Best regards, -- Nicolas Frattaroli <[email protected]>
