gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
authorMarek Vasut <marex@denx.de>
Mon, 16 Jan 2023 09:49:56 +0000 (10:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:08 +0000 (08:27 +0100)
commit8335f877efe758e4d0eee63ca316f8d6f7e8ed04
treef137204228808e5a6aa2d2c23b4a2726a2716d3c
parentfb4fb3d267c9e8b46b9e69332a06a5b3e3c91dfc
gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock

[ Upstream commit e5464277625c1aca5c002e0f470377cdd6816dcf ]

The driver currently performs register read-modify-write without locking
in its irqchip part, this could lead to a race condition when configuring
interrupt mode setting. Add the missing bgpio spinlock lock/unlock around
the register read-modify-write.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-mxc.c