]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: sim: mark the GPIO chip as a one that can sleep
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 1 Aug 2023 19:09:51 +0000 (21:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:32:29 +0000 (18:32 +0200)
commit373b7dbe1c3ddaf0b885a3d490fa340eb27c8685
treedd0ade8e46dc77b686e24e076a714dc1ef29623c
parentc2e0d39e76be2b99ebd2aec4e6ccc83b465d8174
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>
drivers/gpio/gpio-sim.c