]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pca953x: Add mutex_lock for regcache sync in PM
authorHaibo Chen <haibo.chen@nxp.com>
Wed, 31 Aug 2022 10:37:35 +0000 (18:37 +0800)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 31 Aug 2022 11:40:47 +0000 (13:40 +0200)
commit02db140e85ae0ad47fc86e8517dec85b213d9c90
tree68273e9a00e350b49c3f0cb7d2c60d82f0d85f6f
parent6176a435ef4cee065036fa874073f86ff90666ca
gpio: pca953x: Add mutex_lock for regcache sync in PM

The regcache sync will set the cache_bypass = true, at that
time, when there is regmap write operation, it will bypass
the regmap cache, then the regcache sync will write back the
value from cache to register, which is not as our expectation.

Though regmap already use its internal lock to avoid such issue,
but this driver force disable the regmap internal lock in its
regmap config: disable_locking = true

To avoid this issue, use the driver's own lock to do the protect
in system PM.

Fixes: 1f4183c28ac6 ("gpio: pca953x: Restore registers after suspend/resume cycle")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-pca953x.c