From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB1F7C9830E for ; Sun, 27 Sep 2026 23:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OflXaFBWxwBd06gPa8AR9/ryI/v+RvG8l+B2MeCj0RQ=; b=LjO2o5Nq5HCFPyYHO/mCTr3Qgu HcKZYTGZiNqmEqPxxKf88EO04/X5xV+MhZvC2MrlGNy0BSwbJXVbjVjjzIWJqw+jKQf8VhXIbWIxC XFJz5OKY7+gcV9T7b5GcCSXr0AXoh5GP4G//6SovXYfL1Tk3jI9KBy0+AAQxuFmnJrSXmU/Xbj7rw ++YzTYUSWdj7JVEZpkjrBpELGaxKzbOaTrKQdl2TXDYnZ0UGNGBJ2dSXO6eOXMhtDfjL8ixriwWcB d7OQmKBPnTZHzz1tTVoO1tDqPwd9eVonmjF7FiEf5G8G8nBOaypiePbBduEsTYTMm87IZYWKeLXrw GIyl0EoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xAye3-0000000H1ZU-4A4Z; Sun, 27 Sep 2026 23:50:59 +0000 Received: from pidgin.makrotopia.org ([2a07:2ec0:3002::65]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xAydu-0000000H1OQ-0r6O; Sun, 27 Sep 2026 23:50:51 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256:X25519MLKEM768) (Exim 4.100) (envelope-from ) id 1xAydp-000000000r0-12cY; Sun, 27 Sep 2026 23:50:45 +0000 Date: Mon, 28 Sep 2026 00:50:42 +0100 From: Daniel Golle To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Hermes Wu , Allen Chen , Pin-yen Lin , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v8 09/14] drm/bridge: it6505: guard against zero channel count in audio infoframe Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260927_165050_248287_C5A8A788 X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org it6505->audio.channel_count stays 0 until link training or a valid hw_params call has run, but it6505_enable_audio() can be reached before that from the audio-FIFO-error IRQ, making it6505_enable_audio_infoframe() index the 8-entry audio_info_ca[] table with -1. Bail out while the channel count is not yet known. Also fix the debug print on the invalid-channel-count path, which logged the previously cached count instead of the rejected one. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Daniel Golle Reviewed-by: Chen-Yu Tsai --- v8: no changes v7: no changes v6: no changes v5: no changes v4: no changes, collected Chen-Yu Tsai's Reviewed-by v3: new patch --- drivers/gpu/drm/bridge/ite-it6505.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 0d21014324167..3f17024116e14 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1577,6 +1577,9 @@ static void it6505_enable_audio_infoframe(struct it6505 *it6505) struct device *dev = it6505->dev; u8 audio_info_ca[] = { 0x00, 0x00, 0x01, 0x03, 0x07, 0x0B, 0x0F, 0x1F }; + if (!it6505->audio.channel_count) + return; + DRM_DEV_DEBUG_DRIVER(dev, "infoframe channel_allocation:0x%02x", audio_info_ca[it6505->audio.channel_count - 1]); @@ -3012,7 +3015,7 @@ static int __maybe_unused it6505_audio_setup_hw_params(struct it6505 *it6505, if (params->cea.channels <= 1 || params->cea.channels > 8) { DRM_DEV_DEBUG_DRIVER(dev, "channel number: %d not support", - it6505->audio.channel_count); + params->cea.channels); return -EINVAL; } -- 2.55.0