]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda/realtek: Fix deadlock by COEF mutex
authorTakashi Iwai <tiwai@suse.de>
Mon, 14 Feb 2022 13:04:10 +0000 (14:04 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 14 Feb 2022 13:04:48 +0000 (14:04 +0100)
commit7cabb383acd36e7abdd765a339495cca62dac0d9
tree223ca9fc213b8715868a1042ca6c752fd88bd0be
parentc4e9bca8f09ae4b788acd56df7bdd408d056ca05
ALSA: hda/realtek: Fix deadlock by COEF mutex

The recently introduced coef_mutex for Realtek codec seems causing a
deadlock when the relevant code is invoked from the power-off state;
then the HD-audio core tries to power-up internally, and this kicks
off the codec runtime PM code that tries to take the same coef_mutex.

In order to avoid the deadlock, do the temporary power up/down around
the coef_mutex acquisition and release.  This assures that the
power-up sequence runs before the mutex, hence no re-entrance will
happen.

Fixes: 68c0a3257146 ("ALSA: hda: realtek: Fix race at concurrent COEF updates")
Reported-and-tested-by: Julian Wollrath <jwollrath@web.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220214132838.4db10fca@schienar
Link: https://lore.kernel.org/r/20220214130410.21230-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c