linux-stable/drivers/pinctrl
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
..
actions
aspeed pinctrl: aspeed: Revert "Force to disable the function's signal" 2023-02-14 19:11:50 +01:00
bcm pinctrl-bcm2835.c: fix race condition when setting gpio dir 2023-05-11 23:03:37 +09:00
berlin
cirrus
freescale
intel pinctrl: intel: Restore the pins that used to be in Direct IRQ mode 2023-02-14 19:11:51 +01:00
mediatek pinctrl: mediatek: Initialize variable *buf to zero 2023-03-10 09:33:16 +01:00
meson
mvebu
nomadik
nuvoton
pxa
qcom pinctrl: qcom: lpass-lpi: set output value before enabling output 2023-05-11 23:03:02 +09:00
ralink pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible string 2023-05-11 23:03:36 +09:00
renesas pinctrl: renesas: r8a779g0: Fix ERROROUTC function names 2023-05-11 23:03:36 +09:00
samsung
spear
sprd
starfive
stm32 pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain 2023-03-10 09:33:11 +01:00
sunplus
sunxi These are the pin control changes for the v6.1 kernel cycle: 2022-10-11 10:59:59 -07:00
tegra
ti
uniphier
visconti
vt8500
core.c
core.h
devicetree.c pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map 2022-11-10 12:26:18 +01:00
devicetree.h
Kconfig These are the pin control changes for the v6.1 kernel cycle: 2022-10-11 10:59:59 -07:00
Makefile
pinconf-generic.c pinctrl: pinconf-generic: add missing of_node_put() 2022-12-31 13:32:16 +01:00
pinconf.c
pinconf.h
pinctrl-amd.c Revert "pinctrl: amd: Disable and mask interrupts on resume" 2023-04-20 12:35:05 +02:00
pinctrl-amd.h
pinctrl-apple-gpio.c
pinctrl-artpec6.c
pinctrl-as3722.c
pinctrl-at91-pio4.c pinctrl: at91-pio4: fix domain name assignment 2023-04-06 12:10:53 +02:00
pinctrl-at91.c pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:33:59 +01:00
pinctrl-at91.h
pinctrl-axp209.c
pinctrl-bm1880.c
pinctrl-cy8c95x0.c
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-equilibrium.c
pinctrl-equilibrium.h
pinctrl-falcon.c
pinctrl-gemini.c
pinctrl-ingenic.c pinctrl: Ingenic: JZ4755 bug fixes 2022-10-17 11:47:38 +02:00
pinctrl-k210.c pinctrl: k210: call of_node_put() 2022-12-31 13:32:14 +01:00
pinctrl-keembay.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08.c
pinctrl-mcp23s08.h
pinctrl-mcp23s08_i2c.c
pinctrl-mcp23s08_spi.c
pinctrl-microchip-sgpio.c These are the pin control changes for the v6.1 kernel cycle: 2022-10-11 10:59:59 -07:00
pinctrl-ocelot.c pinctrl: ocelot: Fix alt mode for ocelot 2023-04-06 12:10:49 +02:00
pinctrl-oxnas.c
pinctrl-palmas.c
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rk805.c
pinctrl-rockchip.c pinctrl: rockchip: Fix refcount leak in rockchip_pinctrl_parse_groups 2023-03-10 09:33:11 +01:00
pinctrl-rockchip.h
pinctrl-single.c pinctrl: single: fix potential NULL dereference 2023-02-14 19:11:50 +01:00
pinctrl-st.c
pinctrl-stmfx.c
pinctrl-sx150x.c
pinctrl-tb10x.c
pinctrl-thunderbay.c pinctrl: thunderbay: fix possible memory leak in thunderbay_build_functions() 2022-12-31 13:32:23 +01:00
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c
pinctrl-zynq.c
pinctrl-zynqmp.c Revert "pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high-impedance" 2022-10-18 09:50:29 +02:00
pinmux.c
pinmux.h