pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping
Subsystems (5)
PATCH 1/1 pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
--- drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/meson/pinctrl-amlogic-a4.c +1 -1
@@ -893,7 +893,7 @@ static const struct gpio_chip aml_gpio_template = { .direction_input = aml_gpio_direction_input, .direction_output = aml_gpio_direction_output, .get_direction = aml_gpio_get_direction, - .can_sleep = false, + .can_sleep = true, }; static void init_bank_register_bit(struct aml_pinctrl *info,
Signature · 1 line
2.47.3
Quoted 19 lines · Bartosz Golaszewski
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
Fixes 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")Reported-by Martin Blumenstingl <[email protected]>Closes https://lore.kernel.org/all/CAFBinCAc7CO8gfNQakCu3LfkYXuyTd2iRpMRm8EKXSL0mwOnJw@mail.gmail.com/ open hereSigned-off-by Bartosz Golaszewski <[email protected]>--- drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/meson/pinctrl-amlogic-a4.c +0
-0
drivers/pinctrl/meson/pinctrl-amlogic-a4.c static const struct gpio_chip aml_gpio_template = { · line 899
Quoted 8 lines
drivers/pinctrl/meson/pinctrl-amlogic-a4.c +1
-1@@ -893,7 +893,7 @@ static const struct gpio_chip aml_gpio_template = { .direction_input = aml_gpio_direction_input, .direction_output = aml_gpio_direction_output, .get_direction = aml_gpio_get_direction, - .can_sleep = false, + .can_sleep = true, }; static void init_bank_register_bit(struct aml_pinctrl *info,
Thanks,
Neil
Xianwei Zhao
maintainerHi Bartosz,
Could you explain the reproduction method for this problem ?
Quoted 27 lines · Neil Armstrong
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
Fixes 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")Reported-by Martin Blumenstingl <[email protected]>Closes https://lore.kernel.org/all/CAFBinCAc7CO8gfNQakCu3LfkYXuyTd2iRpMRm8EKXSL0mwOnJw@mail.gmail.com/ open hereSigned-off-by Bartosz Golaszewski <[email protected]>--- drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/meson/pinctrl-amlogic-a4.c +1
-1@@ -893,7 +893,7 @@ static const struct gpio_chip aml_gpio_template = { .direction_input = aml_gpio_direction_input, .direction_output = aml_gpio_direction_output, .get_direction = aml_gpio_get_direction, - .can_sleep = false, + .can_sleep = true, }; static void init_bank_register_bit(struct aml_pinctrl *info,
Bartosz Golaszewski
maintainerQuoted 4 lines · Xianwei Zhao
Hi Bartosz,
Could you explain the reproduction method for this problem ?
Please don't top-post on the mailing list.
If you have a pin shared by multiple devices in device-tree, it will now go through a dedicated gpio-shared-proxy driver. It will use a locking mechanism depending on the can_sleep flag of the GPIO controller device - spinlock or mutex. If the flag is wrong - like is the case here - it may happen that we take a spinlock and then descend into pinctrl where a mutex is taken resulting in a lockdep splat.
Bart
Quoted 11 lines · Bartosz Golaszewski
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
Fixes 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")Reported-by Martin Blumenstingl <[email protected]>Closes https://lore.kernel.org/all/CAFBinCAc7CO8gfNQakCu3LfkYXuyTd2iRpMRm8EKXSL0mwOnJw@mail.gmail.com/ open hereSigned-off-by Bartosz Golaszewski <[email protected]>
Linus Walleij
maintainerQuoted 10 lines · Bartosz Golaszewski
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
Fixes 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")Reported-by Martin Blumenstingl <[email protected]>Closes https://lore.kernel.org/all/CAFBinCAc7CO8gfNQakCu3LfkYXuyTd2iRpMRm8EKXSL0mwOnJw@mail.gmail.com/ open hereSigned-off-by Bartosz Golaszewski <[email protected]>
Patch applied for fixes!
Yours,
Linus Walleij
Linus Walleij
maintainerQuoted 4 lines · Bartosz Golaszewski
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
BTW it is a very *welcome* side-effect of the new shared GPIO rework that it just happens to find these old bugs, I'm very pleased with this :)
Yours,
Linus Walleij
Bartosz Golaszewski
maintainerQuoted 4 lines · Linus Walleij
On Tue, Jan 6, 2026 at 9:53 AM Bartosz Golaszewski <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver.
BTW it is a very *welcome* side-effect of the new shared GPIO rework that it just happens to find these old bugs, I'm very pleased with this :)
Actually, I was surprised I was getting so many bug reports and then it turned out, there was a bug that caused a lot of false-positives to turn up when scanning the devicetree for shared pins. I just queued a fix for that so it should slow down now.
Bart