aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-cdev.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <[email protected]>2024-01-29 09:23:27 +0000
committerBartosz Golaszewski <[email protected]>2024-02-12 09:50:34 +0000
commitccfb6ff4f6c0574e01fb16934fb60a46285c5f3f (patch)
tree393688dcae1123fbcbcb76d109219531f4519f89 /drivers/gpio/gpiolib-cdev.c
parentgpio: provide and use gpiod_get_label() (diff)
downloadkernel-ccfb6ff4f6c0574e01fb16934fb60a46285c5f3f.tar.gz
kernel-ccfb6ff4f6c0574e01fb16934fb60a46285c5f3f.zip
gpio: don't set label from irq helpers
We will soon serialize access to the descriptor label using SRCU. The write-side of the protection will require calling synchronize_srcu() which must not be called from atomic context. We have two irq helpers: gpiochip_lock_as_irq() and gpiochip_unlock_as_irq() that set the label if the GPIO is not requested but is being used as interrupt. They are called with a spinlock held from the interrupt subsystem. They must not do it if we are to use SRCU so instead let's move the special corner case to a dedicated getter. Don't actually set the label to "interrupt" in the above case but rather use the newly added gpiod_get_label() helper to hide the logic that atomically checks the descriptor flags and returns the address of a static "interrupt" string. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Acked-by: Andy Shevchenko <[email protected]>
Diffstat (limited to 'drivers/gpio/gpiolib-cdev.c')
0 files changed, 0 insertions, 0 deletions