linux-stable/drivers/pinctrl
Hans Verkuil 71be862f80 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:11:31 +09:00
..
actions intel-pinctrl for v6.1-2 2022-10-26 09:58:29 +02:00
aspeed pinctrl: aspeed: Revert "Force to disable the function's signal" 2023-01-30 23:51:03 +01:00
bcm pinctrl-bcm2835.c: fix race condition when setting gpio dir 2023-05-11 23:11:31 +09:00
berlin pinctrl: berlin: fix spelling typo in comment 2022-09-05 14:10:14 +02:00
cirrus pinctrl: lochnagar: Add missing header(s) 2022-10-24 17:06:46 +03:00
freescale pinctrl: freescale: Fix i.MXRT1050 pad names 2022-11-10 09:19:43 +01:00
intel pinctrl: intel: Restore the pins that used to be in Direct IRQ mode 2023-02-07 10:13:51 +01:00
mediatek pinctrl: mediatek: Initialize variable *buf to zero 2023-03-10 09:28:33 +01:00
meson pinctrl: meson: Switch to use fwnode instead of of_node 2022-09-08 10:35:30 +02:00
mvebu pinctrl: mvebu: Add missing header(s) 2022-10-24 17:06:46 +03:00
nomadik pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
nuvoton pinctrl: nuvoton: wpcm450: Fix handling of inverted MFSEL bits 2022-11-10 09:19:42 +01:00
pxa
qcom pinctrl: qcom: lpass-lpi: set output value before enabling output 2023-05-11 23:10:51 +09:00
ralink pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible string 2023-05-11 23:11:30 +09:00
renesas pinctrl: renesas: r8a779g0: Fix ERROROUTC function names 2023-05-11 23:11:30 +09:00
samsung pinctrl: samsung: Add missing header(s) 2022-10-24 17:06:46 +03:00
spear pinctrl: spear: Add missing header(s) 2022-10-24 17:06:47 +03:00
sprd pinctrl: sprd: Add missing header(s) 2022-10-24 17:06:47 +03:00
starfive pinctrl: starfive: Use existing variable gpio 2022-11-22 09:25:30 +01:00
stm32 pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain 2023-03-10 09:28:27 +01:00
sunplus pinctrl: sp7021: fix unused function warning 2022-12-29 02:07:25 +01:00
sunxi pinctrl: sunxi: d1: Add CAN bus pinmuxes 2022-11-26 22:57:50 +01:00
tegra pinctrl: tegra: Separate Tegra194 instances 2022-11-14 14:16:46 +01:00
ti pinctrl: ti-iodelay: Add missing header(s) 2022-10-24 17:06:47 +03:00
uniphier pinctrl: uniphier: Add missing header(s) 2022-10-24 17:06:47 +03:00
visconti
vt8500
core.c pinctrl: Move for_each_maps() to namespace and hide iterator inside 2022-11-14 14:19:33 +01:00
core.h pinctrl: Move for_each_maps() to namespace and hide iterator inside 2022-11-14 14:19:33 +01:00
devicetree.c pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map 2022-11-10 12:26:18 +01:00
devicetree.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
Kconfig pinctrl: pinctrl-loongson2: fix Kconfig dependency 2022-11-21 14:36:03 +01:00
Makefile pinctrl: pinctrl-loongson2: add pinctrl driver support 2022-11-17 10:24:08 +01:00
pinconf-generic.c pinctrl: pinconf-generic: add missing of_node_put() 2022-11-25 10:49:28 +01:00
pinconf.c
pinconf.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
pinctrl-amd.c Revert "pinctrl: amd: Disable and mask interrupts on resume" 2023-04-20 12:36:50 +02:00
pinctrl-amd.h pinctrl: amd: Implement pinmux functionality 2022-06-15 15:54:20 +02:00
pinctrl-apple-gpio.c pinctrl: apple-gpio: Add missing header(s) 2022-10-24 12:31:17 +03:00
pinctrl-artpec6.c
pinctrl-as3722.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE 2022-06-10 14:51:36 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: fix domain name assignment 2023-04-06 12:12:43 +02:00
pinctrl-at91.c pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:29:19 +01:00
pinctrl-at91.h
pinctrl-axp209.c pinctrl: axp209: Add missing header(s) 2022-10-24 12:31:55 +03:00
pinctrl-bm1880.c pinctrl: bm1880: Add missing header(s) 2022-10-24 12:53:33 +03:00
pinctrl-cy8c95x0.c intel-pinctrl for v6.1-2 2022-10-26 09:58:29 +02:00
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-equilibrium.c pinctrl: equilibrium: Switch to use fwnode instead of of_node 2022-05-09 13:46:51 +02:00
pinctrl-equilibrium.h pinctrl: equilibrium: Switch to use fwnode instead of of_node 2022-05-09 13:46:51 +02:00
pinctrl-falcon.c pinctrl: lantiq: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-gemini.c pinctrl: gemini: Add missing header(s) 2022-10-24 17:06:45 +03:00
pinctrl-ingenic.c Pin control changes for the v6.2 kernel cycle: 2022-12-13 13:03:06 -08:00
pinctrl-k210.c pinctrl: k210: call of_node_put() 2022-11-22 09:35:27 +01:00
pinctrl-keembay.c
pinctrl-lantiq.c pinctrl: lantiq: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-lantiq.h pinctrl: lantiq: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-loongson2.c pinctrl: loongson2: Fix some const correctness 2022-11-25 11:41:01 +01:00
pinctrl-lpc18xx.c pinctrl: lpc18xx: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-max77620.c pinctrl: max77620: drop unneeded MODULE_ALIAS 2022-04-22 22:56:46 +02:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Drop assignment of default number of OF cells 2022-09-03 00:17:35 +02:00
pinctrl-mcp23s08.h
pinctrl-mcp23s08_i2c.c
pinctrl-mcp23s08_spi.c
pinctrl-microchip-sgpio.c pinctrl: microchip-sgpio: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-ocelot.c pinctrl: ocelot: Fix alt mode for ocelot 2023-04-06 12:12:40 +02:00
pinctrl-oxnas.c
pinctrl-palmas.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE 2022-06-10 14:51:36 +02:00
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c pinctrl: pistachio: Correct the fwnode_irq_get() return value check 2022-09-08 15:18:58 +02:00
pinctrl-rk805.c
pinctrl-rockchip.c pinctrl: rockchip: Fix refcount leak in rockchip_pinctrl_parse_groups 2023-03-10 09:28:28 +01:00
pinctrl-rockchip.h pinctrl: rockchip: Add RV1126 pinctrl support 2022-08-22 09:51:08 +02:00
pinctrl-single.c pinctrl: single: fix potential NULL dereference 2023-01-27 13:43:55 +01:00
pinctrl-st.c intel-pinctrl for v6.1-2 2022-10-26 09:58:29 +02:00
pinctrl-stmfx.c pinctrl: stmfx: Add missing header(s) 2022-10-24 17:06:47 +03:00
pinctrl-sx150x.c
pinctrl-tb10x.c
pinctrl-thunderbay.c pinctrl: thunderbay: fix possible memory leak in thunderbay_build_functions() 2022-12-06 15:28:14 +01:00
pinctrl-utils.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE 2022-06-10 14:51:36 +02:00
pinctrl-utils.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
pinctrl-xway.c
pinctrl-zynq.c
pinctrl-zynqmp.c Pin control changes for the v6.2 kernel cycle: 2022-12-13 13:03:06 -08:00
pinmux.c pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
pinmux.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00