[PATCH 0/2] gpio: use raw spinlocks in irq startup paths
From: Runyu Xiao
Date: Wed Jun 17 2026 - 11:52:37 EST
This 2-patch series fixes two GPIO irqchip paths where IRQ startup or
unmask can update controller state under a regular spinlock. On
PREEMPT_RT, that lock can sleep while irq_startup() is running in a
non-sleepable context.
Both issues were found by our static analysis tool and then manually
reviewed against the current tree. The grounded PoCs kept the
request_threaded_irq() -> __setup_irq() -> irq_startup() carriers and
Lockdep reported "BUG: sleeping function called from invalid context" on
the corresponding driver update helpers.
Convert the affected register locks to raw_spinlock_t. The locked
sections only serialize MMIO register access and irqchip state updates,
so they should remain non-sleeping. The conversion does not move any
sleepable operation under a raw lock; it preserves the existing short
register-critical sections while making their non-sleeping requirement
explicit for PREEMPT_RT.
Runyu Xiao (2):
gpio: sch: use raw_spinlock_t in the irq startup path
gpio: eic-sprd: use raw_spinlock_t in the irq startup path
drivers/gpio/gpio-eic-sprd.c | 8 ++++----
drivers/gpio/gpio-sch.c | 32 ++++++++++++++++----------------
2 files changed, 20 insertions(+), 20 deletions(-)
--
2.34.1