]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
authorDouglas Anderson <dianders@chromium.org>
Wed, 29 Mar 2023 21:33:53 +0000 (14:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:37 +0000 (11:35 +0200)
commitd3ed65152f78d717c73a25328ad212236e73742a
tree6688d4d7de94a5a4e0076ab0f1db588d2b0cf596
parentf12e05a742853ca492643f80dae93a00d68d81a9
regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()

[ Upstream commit b83a1772be854f87602de14726737d3e5b06e1f4 ]

When a codepath locks a rdev using ww_mutex_lock_slow() directly then
that codepath is responsible for incrementing the "ref_cnt" and also
setting the "mutex_owner" to "current".

The regulator core consistently got that right for "ref_cnt" but
didn't always get it right for "mutex_owner". Let's fix this.

It's unlikely that this truly matters because the "mutex_owner" is
only needed if we're going to do subsequent locking of the same
rdev. However, even though it's not truly needed it seems less
surprising if we consistently set "mutex_owner" properly.

Fixes: 206a0af25ab1 ("regulator: core: Use ww_mutex for regulators locking")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230329143317.RFC.v2.1.I4e9d433ea26360c06dd1381d091c82bb1a4ce843@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/core.c