]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: cs42l43: Cache shutter IRQ control pointers
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 2 Aug 2024 10:57:34 +0000 (11:57 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 2 Aug 2024 13:04:41 +0000 (14:04 +0100)
commit93afd028fb5f06a46a32375fd1f0473451eb1c5a
tree4fb3b7a7cadfb656370af85634916035e8e5ba43
parent4791c422981350d0de4ad02a14a08b99c766d06f
ASoC: cs42l43: Cache shutter IRQ control pointers

The microphone/speaker privacy shutter ALSA control handlers need to
call pm_runtime_resume, since the hardware needs to be powered up to
check the hardware state of the shutter. The IRQ handler for the
shutters also needs to notify the ALSA control to inform user-space
the shutters updated. However this leads to a mutex inversion,
between the sdw_dev_lock and the controls_rwsem.

To avoid this mutex inversion cache the kctl pointers before the IRQ
handler, which avoids the need to lookup the control and take the
controls_rwsem.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l43.c
sound/soc/codecs/cs42l43.h