From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F8A01EE01A for ; Sun, 10 May 2026 12:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=121.127.44.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778416932; cv=none; b=RQrUPd6n1m1z1BhnnFwrhZ8dTIiuxmYeep9zkWUfUXvc4QB5qbX6UeUDugGxzy1v8q6Jug46YQpbIXIJDM6FngCZlNFmh/rnbbGdRp2138uZHN2+4p7ihH8ferHpDLBd3hWYijc8LMg2EgRzAj/Ni8Mhqm/Bl4plqbBX6AMmECE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778416932; c=relaxed/simple; bh=+Yr0ipp72YLh8acA0yYShbTfltwateCOU5DQOAmdy1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HMVlSb/R+P4++579KmmictYYtfwdZe4jNCyEp7SHkIcW2DKVojMlBR7m20fRu7kLftkU0zurtCj5vnEnM97jd0Hz9Xhg8IfhUkvyCXEkxfkiPdQIXEFN25lBSVb+lQ3b3uObXYKcq9psEG0zxH9Pqv+SDv/VclwofJyh4Kl1y/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=IByFya/2; arc=none smtp.client-ip=121.127.44.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="IByFya/2" 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=1778416916; bh=PnDcLXlbaPre88s1ZNqSGlXUJXg3TERiDNCZdw2MtJ4=; b=IByFya/21RAc3Hb6e8VI9V+K23HFUfCa492hdUsJyoE9Erc5z7dXILyPIk/xv7jWK58QeUqvr +ieExdpRFFtgv9EBBLNTYPuEjoxAljTSWA7iEz9QbW2gXL/dbZj5JeRBT3WqraCVtysxLkjVc/u na0hbgnwlkZslu8xmUViEEn1Ye+RicJku5BpcezlVPX+z7LuL1xW7rb8l2tiKQ8/Q63AQA3U/3E +tzNeIk4K9rWtKcpI5T1germh2nYrTKD7MhsJKvB6fD1/wkGDADlzTk+lGZkgsmJEu0kpLynU5K vhwypZwcAEQ4Ubvp/OlPDPUaAljr+e2DVeJkWgRIXz7Q== X-Forward-Email-ID: 6a007cf70d91f03a31a0bb1d X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.73 X-Forward-Email-Version: 2.8.0 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 Cc: Liu Ying , Sandy Huang , Andy Yan , Chen-Yu Tsai , Christian Hewitt , Diederik de Haas , Nicolas Frattaroli , Dmitry Baryshkov , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v5 02/21] drm: bridge: dw_hdmi: Only notify connected status on HPD interrupt Date: Sun, 10 May 2026 12:40:46 +0000 Message-ID: <20260510124111.1226584-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260510124111.1226584-1-jonas@kwiboo.se> References: <20260510124111.1226584-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jonas Karlman --- 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