Re: [PATCH v2] gpio: pca953x: fix pca953x_irq_bus_sync_unlock regmap lock

From: Mark Tomlinson

Date: Sun Jul 12 2026 - 16:38:59 EST


On Thu, 2026-07-09 at 04:02 -0400, Bartosz Golaszewski wrote:
> On Thu, 9 Jul 2026 06:51:16 +0200, Mark Tomlinson
> <mark.tomlinson@xxxxxxxxxxxxxxxxxxx> said:
> > 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@xxxxxxxxxxxxxxx
> > Signed-off-by: Mark Tomlinson <mark.tomlinson@xxxxxxxxxxxxxxxxxxx>
> > ---
>
> Please always include the entire changelog for the series, I don't know
> what
> changed since v1 (no need to resend, just explain here).

Changes from v1 to v2 are:

1) Added Fixes: and Cc: tags
2) Changed function name from _pca953x_gpio_direction_input() to
pca953x_gpio_direction_input_unlocked().
3) Changed 'unsigned' to 'unsigned int' in the code affected by this patch.

There is no functional change.

Thanks,