• Lukas Wunner's avatar
    pinctrl: bcm2835: Use raw spinlock for RT compatibility · 0dcf13d9
    Lukas Wunner authored
    [ Upstream commit 3c7b30f7 ]
    
    The BCM2835 pinctrl driver acquires a spinlock in its ->irq_enable,
    ->irq_disable and ->irq_set_type callbacks.  Spinlocks become sleeping
    locks with CONFIG_PREEMPT_RT_FULL=y, therefore invocation of one of the
    callbacks in atomic context may cause a hard lockup if at least two GPIO
    pins in the same bank are used as interrupts.  The issue doesn't occur
    with just a single interrupt pin per bank because the lock is never
    contended.  I'm experiencing such lockups with GPIO 8 and 28 used as
    level-triggered interrupts, i.e. with ->irq_disable being invoked on
    reception of every IRQ.
    
    The critical section protected by the spinlock is very small (one bitop
    and one RMW of an MMIO register), hence converting to a raw spinlock
    seems a better trade-off than converting the driver to threaded IRQ
    handling (which would increase latency to handle an interrupt).
    
    Cc: Mathias Duckeck <m.duckeck@kunbus.de>
    Signed-off-by: 's avatarLukas Wunner <lukas@wunner.de>
    Acked-by: 's avatarJulia Cartwright <julia@ni.com>
    Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    0dcf13d9
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
pinctrl-bcm281xx.c Loading commit data...
pinctrl-bcm2835.c Loading commit data...
pinctrl-cygnus-mux.c Loading commit data...
pinctrl-iproc-gpio.c Loading commit data...
pinctrl-ns.c Loading commit data...
pinctrl-ns2-mux.c Loading commit data...
pinctrl-nsp-gpio.c Loading commit data...
pinctrl-nsp-mux.c Loading commit data...