mirror-linux/drivers/pinctrl/bcm
Hans Verkuil 86dfb47094 pinctrl-bcm2835.c: fix race condition when setting gpio dir
[ Upstream commit b7badd752d ]

In the past setting the pin direction called pinctrl_gpio_direction()
which uses a mutex to serialize this. That was changed to set the
direction directly in the pin controller driver, but that lost the
serialization mechanism. Since the direction of multiple pins are in
the same register you can have a race condition, something that was
in fact observed with the cec-gpio driver.

Add a new spinlock to serialize writing to the FSEL registers.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 1a4541b68e ("pinctrl-bcm2835: don't call pinctrl_gpio_direction()")
Link: https://lore.kernel.org/r/4302b66b-ca20-0f19-d2aa-ee8661118863@xs4all.nl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:03:37 +09:00
..
Kconfig arm64: bcmbca: Make BCM4908 drivers depend on ARCH_BCMBCA 2022-08-15 09:55:34 -07:00
Makefile pinctrl: bcm: add driver for BCM4908 pinmux 2022-01-25 01:42:13 +01:00
pinctrl-bcm63xx.c
pinctrl-bcm63xx.h pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-bcm281xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
pinctrl-bcm2835.c pinctrl-bcm2835.c: fix race condition when setting gpio dir 2023-05-11 23:03:37 +09:00
pinctrl-bcm4908.c pinctrl: bcm: add driver for BCM4908 pinmux 2022-01-25 01:42:13 +01:00
pinctrl-bcm6318.c pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-bcm6328.c pinctrl: bcm: Remove unused struct bcm6328_pingroup 2022-10-04 09:39:22 +02:00
pinctrl-bcm6358.c pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-bcm6362.c pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-bcm6368.c pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-bcm63268.c pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() 2022-08-25 13:57:00 +02:00
pinctrl-cygnus-mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
pinctrl-iproc-gpio.c pinctrl: Get rid of duplicate of_node assignment in the drivers 2021-12-16 04:18:30 +01:00
pinctrl-ns.c pinctrl: bcm: ns: Remove redundant dev_err call 2022-10-04 09:24:04 +02:00
pinctrl-ns2-mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
pinctrl-nsp-gpio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
pinctrl-nsp-mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00