]> git.ipfire.org Git - thirdparty/linux.git/commit
gpio: pca953x: fix pca953x_irq_bus_sync_unlock regmap lock
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Thu, 9 Jul 2026 04:51:16 +0000 (16:51 +1200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 16 Jul 2026 13:54:32 +0000 (15:54 +0200)
commit9dc325327babe7f159e84cbe9380a45342da0585
treed5e94099822c555e483074ba1f284b4891e42380
parente1cc8fa0fb9e5112d15f2c310b68ac316981c06c
gpio: pca953x: fix pca953x_irq_bus_sync_unlock regmap lock

Locking is disabled in the regmap config as this driver uses its own
lock. This means that all calls to regmap functions (read or write) must
hold the i2c_lock. The function pca953x_irq_bus_sync_unlock() did not do
this, and it was therefore possible that multiple threads could cause an
incorrect register to be read/written.

A previous patch partly fixed this, but only protected the write to the
interrupt mask register, and not the read from the direction register.

Fixes: bfc6444b57dc ("gpio: pca953x: fix pca953x_irq_bus_sync_unlock race")
Cc: stable@vger.kernel.org
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Link: https://patch.msgid.link/20260709045116.2304246-1-mark.tomlinson@alliedtelesis.co.nz
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-pca953x.c