Commit 438dee76 authored by Haibo Chen's avatar Haibo Chen Committed by Jialin Zhang
Browse files

gpio: pca953x: Add mutex_lock for regcache sync in PM

stable inclusion
from stable-v5.10.142
commit 7efcbac55aadd83d616361746d8bb1aabc7ffcdb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CSFH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7efcbac55aadd83d616361746d8bb1aabc7ffcdb



--------------------------------

[ Upstream commit 518e26f1 ]

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: b7657430 ("gpio: pca953x: Restore registers after suspend/resume cycle")
Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 095d36fe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment