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 B6E15CD4F50 for ; Mon, 18 May 2026 18:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZVoq1mjFthsoDeMcRdJlr41aVoqRVx5omDuHxj/J0Tk=; b=KyDnWhfMxQg43N Oyio5Ni2XJYFSYyHK7fA+xtT/y9l4xyZF7g81gugxOpXYvXz+GPTP7o3+axsVZuqxtuWmizP/C2sf GG/7QpJcys0YgKWa1hJcDXrfT07gly26m8SPfwmbUTDyNWIQcGoNkKX3EdMCZDr4XBmwY9SG4RtzU A91HtSyTqdaUm7oBpQRLS9gTqu9vytfpW1oCft8QrpBanVOz90QVyhtMJ/OUyWKlt0OR9/NF2bEl6 Svs7NI1xZ+kU2U+wzG1zLEtobzf8j+Tw5Id65IGIbMjBe1PzG83f8/saYAUpenWrNEv1I7m4sImxT e2HMNC3EXd9D8poFFQbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wP2JP-0000000GU2q-1miJ; Mon, 18 May 2026 18:03:31 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wP2JJ-0000000GTtf-2wPt for linux-amlogic@lists.infradead.org; Mon, 18 May 2026 18:03:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1779127404; bh=fYmxPzn2Z9iehS0fAf63Ttmw7rvgQXUScT2oAp7xhm8=; b=Fuv3TUvMT1WzswDl6pGj/UQsY4xS5BmXyT4FGzhwlo3N0PR7ZOtyCjheOSoe0nwHd6u5oQBDn Sq2AfJRoisXI8HpqaFL/jTXWQgniYaCnpvnOYGgIqTl7kKHFOOZZ5e/UFn8igmLwnar6kTub+cm a0+tNZDq0QUhwFBLNRNhw0loFIlwLISS2V+GQjvEwfhmdbWrVSiFOqbTIsGPA0D622M4Bkmk0F5 SUvUM/alNtOa0bYJSVvZVQ5kDlTmAYtG0zP1i+Lu/IMZUO4T8b0cOTvovIt4sLFETZqjBmm6W2Y D1RY5i2DtdThWuU/H5fDgd/ipMhbXt6uU3BKGqQ9dPFg== X-Forward-Email-ID: 6a0b542db84dbc72d2274dca X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-Forward-Email-Version: 2.8.12 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Andrzej Hajda , Neil Armstrong , Robert Foss , Heiko Stuebner , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Lucas Stach Subject: [PATCH v7 02/23] drm: bridge: dw_hdmi: Only notify connected status on HPD interrupt Date: Mon, 18 May 2026 18:01:38 +0000 Message-ID: <20260518180206.2480119-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518180206.2480119-1-jonas@kwiboo.se> References: <20260518180206.2480119-1-jonas@kwiboo.se> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260518_110325_802847_1CF544A0 X-CRM114-Status: GOOD ( 13.75 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Baryshkov , imx@lists.linux.dev, Liu Ying , linux-kernel@vger.kernel.org, Sandy Huang , dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Diederik de Haas , linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, Andy Yan , Chen-Yu Tsai , Nicolas Frattaroli , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org drm_helper_hpd_irq_event() and drm_bridge_hpd_notify() may incorrectly be called with a connected status when HPD is high and RX sense is changed. This typically happens when the HDMI cable is unplugged, shortly before the HPD is changed to low. The original intent of commit da09daf88108 ("drm: bridge: dw_hdmi: only trigger hotplug event on link change") was to signal hotplug event at correct interrupt states. Based on the commit message the intent was to trigger hotplug event: - when HPD goes high (plugin) - when both HPD and RX sense has gone low (plugout) However, following interrupt state changes can typically be observed when the HDMI cable is unplugged: - RX interrupt: HPD=high RX=low -> triggers a connected event - HPD interrupt: HPD=low RX=low -> triggers a disconnected event Fix this by only notify connected status on the HPD interrupt when HPD is going high, not on the RX sense interrupt when RX sense is changed. After this a connected event should be triggered when HPD=high at HPD interrupt, and a disconnected event should be triggered when both HPD=low and RX=low at either HPD or RX interrupt. Fixes: da09daf88108 ("drm: bridge: dw_hdmi: only trigger hotplug event on link change") Reviewed-by: Nicolas Frattaroli Tested-by: Diederik de Haas # Rock64, RockPro64, Quartz64-B Signed-off-by: Jonas Karlman --- v7: No change v6: Collect t-b tag v5: No change v4: Collect r-b tag v3: Update commit message v2: New patch --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index d3e6a6562870..b7bfc0e9a6b2 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3157,7 +3157,8 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) mutex_unlock(&hdmi->cec_notifier_mutex); } - if (phy_stat & HDMI_PHY_HPD) + if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) && + (phy_stat & HDMI_PHY_HPD)) status = connector_status_connected; if (!(phy_stat & (HDMI_PHY_HPD | HDMI_PHY_RX_SENSE))) -- 2.54.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic