]> 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)
commitad77b70165269ba9b92389e7a0035835da002667
tree223ca9fc213b8715868a1042ca6c752fd88bd0be
parent3815703b0ea0c35955f7ab2866e3a117bcc3785b
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: a9606555a016 ("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