From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796010489; b=BaXHPunMeICyLwq5aaxN1k0CD6XPwrfFD2mrEeoRo1UP79AVKL3rjO6O4dto9f/3J4jt yQIgRowbcrtTdAqIWaGhO8iJmbbVaD8sanPyeDvo7+ksTtds1J6q4hZcngHgqfauRMMU8 tu2wi2COI+lRF+pZKR7NPo4DHpena6Hr7Hq27S/Mi13nIkcXgT0uM2+yKhwLXdKjzKcFn 4W1PVTd954cSeunUz6oaGlUDC+vmwzPYacF5J8MRJ260SV2SBNKe9Li7cqs5BqpAXJP/x VCAxe+XXUl6bX4fnljmErVSXCu1wUoyF6Bxj6Zr8jLoN7AVNWR26iEZRDgZMwkKMTsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796010489; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=zEQJbpwPXKxjKaAJOWgZUgqV40y5TgGipLhlhYBidag=; b=PWXs4qv9nTM5/ZTOvGBhTHnN/O4WtckPOrik0en0RANyFzqfmEz/8id+3Q/bRwUpO6Vh QKglUQEm/K5rfEnpDSRIJtcTMTe3IDphq1UbR2/vEAD419Ajl3VQPTV3JnJtL8LNbscL/ lreUXGcReL+4Vgpf60M9IGjotMD0NSXi2oOncxbd/q3vg5fl5q3dTGgyGnBNXdc8Pud2L CA3cGYFIHmp6WvqMZLkDbCmoA13Og/36Nfa3FazhJ/Fy3toKizYVYqMpzeN+Xa2VqRp89 7VO1v9Z3/lSCnrD1c1ywJUbXMcmgCwXu3RpIvAUQPHBU/UdqpDtCnOE5tBN1b6KLUWA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WDWOTVv2; arc=none smtp.remote-ip=209.85.210.178 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A65D2606A32A for ; Mon, 30 Nov 2026 03:48:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A65D2606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WDWOTVv2 Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-8b5a6f2f27fso3699963b3a.3 for ; Sun, 29 Nov 2026 19:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796010488; x=1796615288; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zEQJbpwPXKxjKaAJOWgZUgqV40y5TgGipLhlhYBidag=; b=WDWOTVv2iVol6a467ELLiGprpIBjAo0xKvEDQ3ilZHPe5j9KuWqygWJaUqnW+8bRmV 8kbRSr7l1kdrkc6v5dQYNjZEQYv0OfLp9nv33lkBEf1fCTLiSkO6oIKkWcrPjC93Gk85 UiXlREj1q8H9YFjLhftogIR9uEeQXtUjhDyXkjLdhrMlyoGBjBX9I6759/RvUMBJN9cx 4jRKwOgzgSk/Vynn8/01Aot4NmqUsVGM9itXLgvr2jSfcNYCsNXcbZSsBewUWmMFk0mN 38ISGVj5XoVZoPB8/Sp/4JhmTYniiHie6g/HMlvIqJ7YASTHJvnU8m10QSkUsFTasCcv 60gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796010488; x=1796615288; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zEQJbpwPXKxjKaAJOWgZUgqV40y5TgGipLhlhYBidag=; b=rP8M9XPQYOj4GZ+5VoOCoh027Hm/54F1hmj3qjWaidTV/hUtksdyOkjI4GnZd63vq7 ILDfbbLpENtE/udGLHwwDGJwiLhidViz9nYk5+ERkJEvAB3chc9gQpabC9CGWtIQzQYK aeg9bIkjzE6edBU3KTPTiBlmJFfXDXayKHw25JFn8OVJZwUXY0TAOF1td/TMyLPyjkPN CNY+m539NCN+oBneaiecHg+8cBAP5sY5mYUW0ImXX5ic/dM5P2wwagzrdz1uCl03fea/ Iy/BXVEaIzyq3hmUYgh82lXdiJEpQK0jPUAn7m6gP+L74PSnTF0kRDY3bM7O7XFvn7L2 kzSQ== X-Forwarded-Encrypted: i=1; AL+hErEhafGJtiL1sX9QgSDgusSRdf2ac7O+dKPOl1+/U6Uct/Qbfa6aQQRX4PMy/VnAqYqEKEselLnZRbFiuQ==@vger.kernel.org X-Gm-Message-State: APuU4Z9l7fCI4xwK8TGA6k/Rc0VCzNrpgVHgoORbQIUb4Rv18aKuyNh8 B3ssWLE7MHhCHDxQg+O5J8xfnRSqBbUARpOMecbMSslaz7OsKHXny6Tk78b1a8lh X-Gm-Gg: AZFdTZeSTtgsFn5i6mTowuIqmDjqi0EEVK5eVIOdwnMSvwg4xMJf4kwjBAPnKYIM76g yXrxYDrriFSrS28XWWCDp3uleFpDEfeb8z1Ski2XkzhCS5E28IgxeKNwwRH0AXPRwG21lrUVv21 I1lLrUUF/kcYlPiWA1lo+s0hM80Fv5ilyfSg4ufddXKUxcyK+gjTgSdjz4ANmcNpxaynwginNkw twgFUpWb04jaPBkiFDUlI4YbvGjIvERffu/XQdTTQixuHTTo3IYZsbGpL2a2HEI07L/WEOCUSqZ NPOiPEm1OcxkhjW1104TwRiS7Nid7+kjui/turhaNTi7tUq4RQ3hfi2GDTn+WYkgXyl46fRTdcx M1MIYJ6DE3fXKJ6AAlITIhlep5/XZm47MAwqltSPEPNhqX0ScpGzV5Zl1IRr+gmzGA9XPjitIzJ +U48ikRIPvzs01uYTJWIMIFzUfjSXNDmhBrtXcJ3WcIDLTyzB758UtxObhB3b1BjFh7xxOLhpTZ JwskwdrojtD7UCWQ/dKDdw2i9riyG15ex3hynhCfqY8wjCta8Z96PUmIdap1DOrXjBCWZw6IVjR C1VO16dUWpho3uXple8JmEg1ayiE1HK/VvRDkbAA/hHy+v24RbvgFOz+cUZv6Opnp1pVA0oKn+k gBcD7bCg= X-Received: by 2002:a05:6a00:2d01:b0:89c:d875:603c with SMTP id d2e1a72fcca58-8c87d615131mr31066088b3a.53.1796010487791; Sun, 29 Nov 2026 19:48:07 -0800 (PST) Received: from DESKTOP-TPPBPA1 (36-226-254-86.dynamic-ip.hinet.net. [36.226.254.86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8ca64ec4b9esm14602129b3a.24.2026.11.29.19.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 19:48:07 -0800 (PST) From: Lin Tzu Yang To: Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , Dmitry Baryshkov , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] ASoC: hdmi-codec: Clear the parsed ELD on unplug Date: Mon, 30 Nov 2026 11:47:59 +0800 Message-ID: <20261130034800.824934-2-rongh7426@gmail.com> X-Mailer: git-send-email 2.51.1.windows.1 In-Reply-To: <20261130034800.824934-1-rongh7426@gmail.com> References: <20261130034800.824934-1-rongh7426@gmail.com> X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. On a Raspberry Pi 5 (vc4 HDMI), forcing the connector off through /sys/class/drm/card1-HDMI-A-1/status leaves /proc/asound/card0/eld#0 at: monitor_name WaveShare eld_version [0x2] CEA-861D or below sad_count 1 Clear eld_parsed together with the raw ELD, as hdmi_codec_startup() already does when it finds an empty ELD. eld_parsed is only used for the procfs file and the log message in plugged_cb(), so nothing else changes. While at it, clear both before reporting the jack change rather than after, so that userspace reacting to the unplug event doesn't read the old ELD. The plug path already updates the ELD before reporting. Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39, with this change applied to its snd-soc-hdmi-codec module), forcing HDMI-A-1 off and back on twice: - before: eld#0 still shows WaveShare after each unplug - after: eld#0 shows an empty ELD (eld_version [0x0], sad_count 0) after each unplug and WaveShare again after each replug - HDMI audio playback still works This change and its description were written with the help of an AI coding assistant (Claude); the testing above was done on real hardware. Fixes: 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs") Signed-off-by: Lin Tzu Yang --- v2: clear the ELD before the jack report instead of after (Mark). The reorder was only build-tested; the v1 test above still applies to the procfs result. sound/soc/codecs/hdmi-codec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index bc59da2..7946f61 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -971,8 +971,9 @@ static void plugged_cb(struct device *dev, bool plugged) } hdmi_codec_jack_report(hcp, SND_JACK_AVOUT); } else { - hdmi_codec_jack_report(hcp, 0); memset(hcp->eld, 0, sizeof(hcp->eld)); + memset(&hcp->eld_parsed, 0, sizeof(hcp->eld_parsed)); + hdmi_codec_jack_report(hcp, 0); } } -- 2.51.1.windows.1