Re: [SPLAT 3/3] gpio: dwapb: Sleeping spinlocks down IRQ mapping

Thomas Gleixner
2021-08-10T20:33:09Z

On Tue, Aug 10 2021 at 14:41, Valentin Schneider wrote:
> [ 11.549824] rt_spin_lock (kernel/locking/rtmutex.c:1641 (discriminator 4) kernel/locking/spinlock_rt.c:30 (discriminator 4) kernel/locking/spinlock_rt.c:36 (discriminator 4) kernel/locking/spinlock_rt.c:44 (discriminator 4))
> [ 11.549827] dwapb_irq_ack (drivers/gpio/gpio-dwapb.c:151 drivers/gpio/gpio-dwapb.c:233) gpio_dwapb
> [ 11.549831] __irq_do_set_handler (kernel/irq/chip.c:414 kernel/irq/chip.c:406 kernel/irq/chip.c:1009)
> [ 11.549833] __irq_set_handler (kernel/irq/internals.h:178 kernel/irq/chip.c:1053)

This is gpio_chip->bgpio_lock which is a regular spinlock. AFAICT this
lock should merely serializing access to MMIO registers, so it should
not be a problem to make this lock raw.

Except for the obligatory exception:

grgpio_irq_handler() holds that lock from the demultiplexing
handler and invokes all handlers for the individual GPIOs which have
interrupts enabled without ever consulting a pending register.

That drivers usage of that lock is interesting in general, see
grgpio_map_irq() for illustration. Quality stuff for mission critical
systems...

But nevertheless it should just work with a raw lock on RT AFACIT.

Thanks,

tglx