summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-08-01 22:09:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-16 19:27:29 +0300
commitb8cd871d0a189a0fd8b8839231c73c313cd0d56e (patch)
tree71b98039fefcb475de49931c72802ab779afd93c /drivers/gpio
parent227bd2c1eab1d885665d68a803dacb2c47f32617 (diff)
downloadlinux-b8cd871d0a189a0fd8b8839231c73c313cd0d56e.tar.xz
gpio: sim: mark the GPIO chip as a one that can sleep
commit 5a78d5db9c90c9dc84212f40a5f2687b7cafc8ec upstream. Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the can_sleep field of the GPIO chip to true to force users to only use threaded irqs. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-sim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index 803676e307d7..fef12e57b1f1 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -425,6 +425,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
gc->set_config = gpio_sim_set_config;
gc->to_irq = gpio_sim_to_irq;
gc->free = gpio_sim_free;
+ gc->can_sleep = true;
ret = devm_gpiochip_add_data(dev, gc, chip);
if (ret)