linux-brain/sound
Kai Vehmanen 8c5f11093e ALSA: hda/hdmi: fix race in monitor detection during probe
[ Upstream commit ca76282b6faffc83601c25bd2a95f635c03503ef ]

A race exists between build_pcms() and build_controls() phases of codec
setup. Build_pcms() sets up notifier for jack events. If a monitor event
is received before build_controls() is run, the initial jack state is
lost and never reported via mixer controls.

The problem can be hit at least with SOF as the controller driver. SOF
calls snd_hda_codec_build_controls() in its workqueue-based probe and
this can be delayed enough to hit the race condition.

Fix the issue by invalidating the per-pin ELD information when
build_controls() is called. The existing call to hdmi_present_sense()
will update the ELD contents. This ensures initial monitor state is
correctly reflected via mixer controls.

BugLink: https://github.com/thesofproject/linux/issues/1687
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200428123836.24512-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-20 08:20:15 +02:00
..
ac97
aoa
arm
atmel
core ALSA: pcm: oss: Place the plugin buffer overflow checks correctly 2020-05-06 08:15:08 +02:00
drivers ALSA: dummy: Fix PCM format loop in proc output 2020-02-11 04:35:11 -08:00
firewire ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context 2020-01-23 08:22:31 +01:00
hda ALSA: hda: do not override bus codec_mask in link_get() 2020-03-12 13:00:10 +01:00
i2c
isa ALSA: opti9xx: shut up gcc-10 range warning 2020-05-06 08:15:15 +02:00
mips
oss
parisc
pci ALSA: hda/hdmi: fix race in monitor detection during probe 2020-05-20 08:20:15 +02:00
pcmcia
ppc
sh ALSA: sh: Fix compile warning wrt const 2020-02-24 08:36:42 +01:00
soc ASoC: rsnd: Fix "status check failed" spam for multi-SSI 2020-05-10 10:31:27 +02:00
sparc
spi
synth
usb ALSA: line6: Fix POD HD500 audio playback 2020-05-06 08:15:08 +02:00
x86
xen
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c sound: fix a memory leak bug 2019-08-08 08:18:32 +02:00