From patchwork Sun May 10 12:40:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 2186 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 8423D1C06E9 for ; Sun, 10 May 2026 14:42:15 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=kwiboo.se; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-23219-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-23219-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 3F1713009995 for ; Sun, 10 May 2026 12:42:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0222E34AB14; Sun, 10 May 2026 12:42:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="IByFya/2" X-Original-To: linux-sunxi@lists.linux.dev 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 4F90E270EDF 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=1778416931; cv=none; b=sP1Y+ttrL3UDBoCHhsFKAjfQBaVRzEGhdquDVx6CZZ20pAWWZvxSmSc4IBtmkTEET80f3oTa130s/apCEIxpwLeGW4yTv82erH/9Fwi3cMJ0ns7Sy6PKWMGNBa7JNxrwM5e0oOx052X0IqqxqoCDbAZ6Y7L/hMrzrCCrExLT5mk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778416931; c=relaxed/simple; bh=+Yr0ipp72YLh8acA0yYShbTfltwateCOU5DQOAmdy1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NODIHKykfFo9rA7X2cMrJUEhppi+kObhAjXI5hEAq8tVivetgoeftKaDr8oNMOhuijfTDvpae4Gq2A+REC+xn2tUNIVpgyqpRpXFgKAyzzqzDCmta1mZdqx3R0M74hrjSE9coDnY48p/+0yOuWXttflvCfW99ZdS6mSzBoAB1bE= 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 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: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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)))