]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: aggregator: Fix calling into sleeping GPIO controllers
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 31 Jan 2022 10:35:53 +0000 (11:35 +0100)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 2 Feb 2022 10:53:46 +0000 (11:53 +0100)
commit2913273097c19492cfb2e34a66c85ba5bfd18113
tree97a40a4c84162dd3ee45968dbbc652c46975ce09
parent2c38746ca2402e938b028d171c771f4caa588787
gpio: aggregator: Fix calling into sleeping GPIO controllers

If the parent GPIO controller is a sleeping controller (e.g. a GPIO
controller connected to I2C), getting or setting a GPIO triggers a
might_sleep() warning.  This happens because the GPIO Aggregator takes
the can_sleep flag into account only for its internal locking, not for
calling into the parent GPIO controller.

Fix this by using the gpiod_[gs]et*_cansleep() APIs when calling into a
sleeping GPIO controller.

Reported-by: Mikko Salomäki <ms@datarespons.se>
Fixes: 611fbfd61b3660f7 ("gpio: Add GPIO Aggregator")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-aggregator.c