Re: [PATCH] ASoC: hdmi-codec: Clear the parsed ELD on unplug
From: Mark Brown
Date: Thu Nov 26 2026 - 11:31:26 EST
> When the sink goes away, plugged_cb() clears the raw ELD but leaves
> hcp->eld_parsed as it was. The eld#N procfs file prints eld_parsed, so
> after an unplug it keeps showing the monitor that was last connected
> until something is plugged in again.
> Fixes: 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs")
> Signed-off-by: Roy <rongh7426@xxxxxxxxx>
Can you please fill out more of your name, see submitting-patches.rst.
> +++ b/sound/soc/codecs/hdmi-codec.c
> @@ -973,6 +973,7 @@ static void plugged_cb(struct device *dev, bool plugged)
> } else {
> hdmi_codec_jack_report(hcp, 0);
> memset(hcp->eld, 0, sizeof(hcp->eld));
> + memset(&hcp->eld_parsed, 0, sizeof(hcp->eld_parsed));
We should probably do the update before the notification, otherwise
userspace could get the notification and read the ELD before it's
updated (this is preexisting but the more we're updating the easier it
is to hit the race).
--
Mark Brown <broonie@xxxxxxxxxx>