linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] gpio: mxc: Locking and direction input fix
@ 2022-07-25 10:34 Marek Vasut
  2022-07-25 10:34 ` [PATCH v5 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Marek Vasut @ 2022-07-25 10:34 UTC (permalink / raw)
  To: linux-gpio
  Cc: Marek Vasut, Bartosz Golaszewski, Linus Walleij, Loic Poulain,
	Marc Zyngier, NXP Linux Team, Peng Fan, Shawn Guo

The irqchip callbacks in gpio-mxc perform register read-modify-write operations
without locking, which may lead to a race condition. Add the missing locking.

In case the GPIO is used as IRQ, make sure it is configured as input.

Marek Vasut (2):
  gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
  gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode

 drivers/gpio/gpio-mxc.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>

-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-29 17:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25 10:34 [PATCH v5 0/2] gpio: mxc: Locking and direction input fix Marek Vasut
2022-07-25 10:34 ` [PATCH v5 1/2] gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock Marek Vasut
2022-07-25 22:36   ` Linus Walleij
2022-07-25 10:34 ` [PATCH v5 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode Marek Vasut
2022-07-25 20:40   ` Andy Shevchenko
2022-07-25 15:50 ` [PATCH v5 0/2] gpio: mxc: Locking and direction input fix Marc Zyngier
2022-08-23 10:41   ` Marek Vasut
2022-08-23 14:20     ` Marc Zyngier
2022-09-29 17:35       ` Marek Vasut
2022-08-26  8:40 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).