Executive brief
The Linux kernel's ml-ioh GPIO driver uses an incorrect lock type that can cause system hangs on real-time preemption kernels. The driver's interrupt and GPIO control functions acquire a regular spinlock while running in a non-sleepable interrupt context, which is invalid under PREEMPT_RT. Converting the lock to a raw spinlock resolves the deadlock risk and ensures reliable GPIO and interrupt handling on real-time systems.
Technical details
This is a locking bug in the ml-ioh GPIO driver (drivers/gpio/gpio-ml-ioh.c). The ioh_irq_type(), ioh_irq_enable(), and ioh_irq_disable() callbacks acquire chip->spinlock (a regular spinlock_t) via spin_lock_irqsave() while the caller already holds desc->lock (a raw_spinlock_t) with hardirqs disabled. On PREEMPT_RT kernels, regular spinlock_t is an rtmutex-backed sleeping lock, making acquisition in a non-sleepable context invalid and causing potential deadlocks. The fix converts the register lock from spinlock_t to raw_spinlock_t, appropriate since all protected critical sections perform only short MMIO register sequences (ioread32/iowrite32) with no sleepable operations. The patch is modeled after a similar prior fix in the gpio-pch driver and is available via commit 600411ea1f2443fdf5b1af9b6480f616d7aff9d0.
Affected products
- Linux Linux kernel All versions with gpio-ml-ioh driver support (since commit 54be566317b6)
Timeline
- 2026-08-26: disclosed
- 2026-07-31: patched: Fix commit 600411ea1f2443fdf5b1af9b6480f616d7aff9d0 authored