gpio: sim: mark the GPIO chip as a one that can sleep
PATCH 1/1 gpio: sim: mark the GPIO chip as a one that can sleep
From: Bartosz Golaszewski <[email protected]>
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.
--- drivers/gpio/gpio-sim.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-sim.c +1 -0
@@ -429,6 +429,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)
Signature · 1 line
2.39.2
Quoted 5 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the
can_sleepfield of the GPIO chip to true to force users to only use threaded irqs.
Ah, good catch! Doesn't it deserve a Fixes tag?
Quoted 20 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/gpio/gpio-sim.c | 1 + 1 file changed, 1 insertion(+)drivers/gpio/gpio-sim.c +1
-0@@ -429,6 +429,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)Signature · 1 line
2.39.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 5 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the
can_sleepfield of the GPIO chip to true to force users to only use threaded irqs.Ah, good catch! Doesn't it deserve a Fixes tag?
I will add it when applying.
Bart
Quoted 29 lines
Reviewed-by Andy Shevchenko <[email protected]>Quoted 18 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/gpio/gpio-sim.c | 1 + 1 file changed, 1 insertion(+)drivers/gpio/gpio-sim.c +1
-1@@ -429,6 +429,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) --Quoted 2 lines
2.39.2
--
With Best Regards,
Andy Shevchenko
Quoted 7 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the
can_sleepfield of the GPIO chip to true to force users to only use threaded irqs.Signed-off-by Bartosz Golaszewski <[email protected]>
Obviously correct.
Yours,
Linus Walleij