From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796010489; b=rGB4rZ8YgNuDn9kSNC4CaduU3wmDHvu+3HeBsM8WiokG7JDaDnwl7QX8Aefs308rxvgK XCJuCuhlhpO6BX2ejAzyxTnB8JrHVGA5nuB1AJ1gIDglFgnP3xqQ7JMxd1OyWP/y99nlO v9myqC8YEwrHFNp8tZmtrADmX0jobnJhTdsULitgXwYLbfuD8HBd7op06zhDhlyz5/8KY JEF7mXqbvdRw3mDLbPQr2Il6ghMRGu4KUNwgox636yWAdzcxP+6vUdeP/XjqCnDyiFKV6 g/4HKVOJ2CF+Nq0mIZOnWURHtY3MMu+GADpdaKrUQ74q5tjaGzfrCyMp2DXv6tBp82g== 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=cIJ94UnH+tFCShAZHpC39fHHV5Y7PXGet1WGg/ZQ/44Q8eZCPOYeF/abpuVgmQly5pmd hXz+1uw93i12AEYWHq+eq8XgVg5eZh66Ip/aZKNQOzXw4ohxbsKcx4vvnZmjBynpQPS7r IgZfvl9ktl2KTYSZBrHhJXRIn3r7r8lxxmjhv9XB65la5KxQetZBejfQL6RUVLdG9nPBO UYjAywKTI9Wxt1LYZhwdM0qUaKdVI9Pck+1XUmnNHFYea31xt8qNTiNkDp4Yf321ki+fZ Hqw1OtFakfqWdbMNVPMST2YD90SoFxFCG44msIgPl6uPEK4xwcVAmXXLWZ8KjcevdCg== 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.174 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 ACD7E606A337 for ; Mon, 30 Nov 2026 03:48:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ACD7E606A337 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-f174.google.com with SMTP id d2e1a72fcca58-8a07078200fso5128996b3a.2 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=KSsMdjFUA6ctkV1C5V6T9qPPx3zXBgidFsZ3LNKjJ2/wpW4LRrCDJhN7K8xlu617ko pg6fMf4lF/YZGAWheFtTB8eTtMwcc+3JbIop/iXidHUOT0MKoshZ5TyNB9sVXROa7h7R OX8GNyLg+sXwOPoyMoqez9ils1t/jXZX23fwMQVKhgEdlzC4f+RDrHSPUaO03i6opQ8O 3HRQ64w7I1jgxBaO3NWZH6T284Zp2fzcrd1jWQG0JaEjmBX69PHYSDMtcAch2hptBFhw MMicdjRdRePJcTdi8/zCrqjFToQVqQ2zXZXyfnLvJO1sQkdiPnk4HLDpV6pSkEogdqPB VhCw== X-Forwarded-Encrypted: i=1; AL+hErEAmtL0RfFAQDz3P1S3slLcab6OUdGgdYc0W+n74Ku4h+MWddv7KL3Z2rUUhJCdMqai48wrbxgN28cNMtY=@vger.kernel.org X-Gm-Message-State: APuU4Z+1jmVDisPr/7iQnTYsv7Qh/AdUpafGH46oRWDNJdHGI/uNW7OG NWbe0NOaB8PGF70Yu9BxFdYkGO9nDDXAmyTXAuh23f5CAcPQKc8z6G+z X-Gm-Gg: AZFdTZcFLCDas+Ez4zObQN6BMg2y44v2qJt6TO6HJ4XFwo8b50/5xK6VCChXuPaLV26 ONs4P2+ZKSo67UViln29afbIZYTyrGegduL8LZJZHOwXEgoWUoNFB3wY4taf1jDOF5/ubAutEqQ TvUVloIRhDBScsh8bHcIwqfCWYs0uAIYTKtPF4lL7KzH8XFYIGKr4i2GvpHFZTvKs+10eHvznpX ObRN9JoPRp5TarAox62BSUWd4c8QR3BcqUNHItsRzEfMMRT7kOzMvZD1Le0welOhz7lWK1uLYBn Y0CVP08pSZL7hsGgv4c3JIMiYcSPs6An92yxie/HWGHpKQmDQd7NyqpEhf+qOIxIy40uzO/Nm4q /+vJ01bDm+dmZeQSMZG5XGUwe3dZQNr0QecTvsxg6ltm/iAg7tbPP5Z/0snDFnjMJVqPs20dM1k v1GM4vN/WbTNinkt7gOPTttWE4sX20y4SJm5vYmsSn47m4p2/+RfVqMiFF32vRq7cmp06klGVCE SHcgbUGr8c93ig95jMF7CXpKOkI45JBRz7DIbRXk8dSdz9SMdYMY0AFv4ZTzdvplsAdMaUnmJy8 CjMBZjjqUvF0QxUBWweGAW0mdXG/4fZ1aqs/eczB5kaweqgsYaxJH2iEA8VLoBqCB5nnVN98eGK 7bMK2nME= 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-kernel@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