summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@linux.intel.com>2020-04-28 15:38:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-20 08:18:40 +0200
commit1b8a1d1351a4cce885ee01a2f47c2c4544138683 (patch)
tree660af407156bf7f37cb7cbbaa5ee1f7fe5704b11 /sound/pci
parent648e920654f4345ecc8765dc5717a4fbce152259 (diff)
downloadlinux-stable-1b8a1d1351a4cce885ee01a2f47c2c4544138683.tar.gz
linux-stable-1b8a1d1351a4cce885ee01a2f47c2c4544138683.tar.bz2
linux-stable-1b8a1d1351a4cce885ee01a2f47c2c4544138683.zip
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>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_hdmi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 12a064f994b1..1d83c3c59e1a 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2211,7 +2211,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
+ struct hdmi_eld *pin_eld = &per_pin->sink_eld;
+ pin_eld->eld_valid = false;
hdmi_present_sense(per_pin, 0);
}