| Message ID | 20260516183838.2024991-10-jonas@kwiboo.se (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-23402-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id B88321C0085 for <noreply@patchwork.local>; Sat, 16 May 2026 20:41:29 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=kwiboo.se; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-23402-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-23402-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id C465F3024715 for <noreply@patchwork.local>; Sat, 16 May 2026 18:40:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE16C33E368; Sat, 16 May 2026 18:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="YnV9wxYV" 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 7E68A3451B0 for <linux-sunxi@lists.linux.dev>; Sat, 16 May 2026 18:39:34 +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=1778956776; cv=none; b=SaRmgMMktlzopnuccto5+S/cYECc4whku/4WhTPYax0EP5qZhfT7VrOC1i+8tjgtfyXwgYtWvJ3rsFCyokaCoyAf1T2wVOXUyQQXOWSzPWCSyjqU0dD35pilC8DY5KZVRoiI9M0euxVHXsFIbksogdnuDzoYQYQBNVGCyE97c1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778956776; c=relaxed/simple; bh=b1larF18e7n9Ud4l2VdVtScHW2jmxxFPQrcYxYJmBB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZQSuDnwHaCq/KwqjJnDjmAQMWH4uEmPfk0dreW1btShGKb5uG+SbCvohcVCBxuPz9vux34Fjp5dcsVgSBl+F4YtLMiWv5Cao24yUxdZ3uCYfJozJ+13wgv1pm8oNv8lKM8tLDfFVWRGJFLY/qGzkMrvK4Jd/WB31lnX8DAgoHzM= 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=YnV9wxYV; 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=1778956774; bh=dj/ugFTuxg9Y2gUue7F99f8b7+N9oaRDZ7y+GQkj02E=; b=YnV9wxYVbTka7ZvM+aAHIlKYXchM6d4R+2jg68LRRBE5Fk31AVR/s/lsPK6xz3KHVORDOkBZA r14pnE88fGwkxCIj0QXDfu8LO0dGH2CZpg10etBvA/t3cuWDGefgay10ojs3y3wUHx9QN9e6Rcd 6IF3z4QI7yJLJtDxSXstWekbdY9nrA0d3Z01wcTWk8A8VMJyYoLQ3LSRr1aatTS7vXK01I7ax7I Jon8w5n5QGjaRjya9wWashFPhwhY6fXqU9lARvhY48u2/WKwZPR4q5nGwfH41ROk+asREM7mTi7 dwfXEqJocnw5CDdxz/06AZ1aSb/0xrBuGUOS5/Uf+0Yg== X-Forward-Email-ID: 6a08b9db79c7625f20eeee00 X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.73 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 <jonas@kwiboo.se> To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Heiko Stuebner <heiko@sntech.de>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Luca Ceresoli <luca.ceresoli@bootlin.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch> Cc: Liu Ying <victor.liu@nxp.com>, Sandy Huang <hjc@rock-chips.com>, Andy Yan <andy.yan@rock-chips.com>, Chen-Yu Tsai <wens@kernel.org>, Christian Hewitt <christianshewitt@gmail.com>, Diederik de Haas <diederik@cknow-tech.com>, Nicolas Frattaroli <nicolas.frattaroli@collabora.com>, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>, 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 v6 09/22] drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect Date: Sat, 16 May 2026 18:38:19 +0000 Message-ID: <20260516183838.2024991-10-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260516183838.2024991-1-jonas@kwiboo.se> References: <20260516183838.2024991-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.66 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[nxp.com,rock-chips.com,kernel.org,gmail.com,cknow-tech.com,collabora.com,oss.qualcomm.com,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,vger.kernel.org]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[28]; TAGGED_RCPT(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,kwiboo.se:email,kwiboo.se:dkim,cknow-tech.com:email,linaro.org:email]; R_DKIM_ALLOW(0.00)[kwiboo.se:s=fe-e1b5cab7be]; FROM_NEQ_ENVFROM(0.00)[jonas@kwiboo.se,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[kwiboo.se,quarantine]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,sntech.de,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch]; DKIM_TRACE(0.00)[kwiboo.se:+]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; RCVD_COUNT_THREE(0.00)[4]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[bounces-23402-noreply=patchwork.local]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: B88321C0085 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?= |
| Series |
drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup
|
|
Commit Message
Jonas Karlman
May 16, 2026, 6:38 p.m. UTC
Wait until the connector detect ops is called to invalidate CEC phys addr instead of doing it directly from the irq handler. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # Rock64, RockPro64, Quartz64-B Signed-off-by: Jonas Karlman <jonas@kwiboo.se> --- v6: Collect t-b tag v5: No change v4: No change v3: No change v2: Collect r-b tag --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
Comments
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Moving CEC physical address invalidation exclusively to dw_hdmi_connector_detect breaks CEC functionality when dw_hdmi operates purely as a DRM bridge. -- commit 05206110d2cbe02dc5e2cae3b6c3e7d2d8cdbe48 Author: Jonas Karlman <jonas@kwiboo.se> Subject: drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect This commit delays the CEC physical address invalidation from the IRQ handler until the connector detect operation is called. > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 5fd26ff8f55b4..aae1b890167b1 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -2472,7 +2472,17 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) > { > struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, > connector); > - return dw_hdmi_detect(hdmi); > + enum drm_connector_status status; > + > + status = dw_hdmi_detect(hdmi); > + > + if (status == connector_status_disconnected) { > + mutex_lock(&hdmi->cec_notifier_mutex); > + cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); > + mutex_unlock(&hdmi->cec_notifier_mutex); > + } > + > + return status; > } Does moving the invalidation exclusively to dw_hdmi_connector_detect break CEC functionality when the hardware operates purely as a DRM bridge? Before this change, cec_notifier_phys_addr_invalidate was called directly from the hardware interrupt handler, guaranteeing execution on disconnect regardless of how the driver was configured. In bridge-only mode, the connector is created externally and dw_hdmi_connector_detect is never executed. The DRM core or downstream component instead calls dw_hdmi_bridge_detect, which was not updated here to include the CEC invalidation logic. The CEC physical address might not be invalidated on unplug in bridge mode, which would be a regression. I see this is addressed later in the series by commit 795c172faddab (drm: bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect()), but this intermediate patch appears to introduce a functional regression that might affect bisection. [ ... ] > @@ -3106,12 +3116,6 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) > phy_stat & HDMI_PHY_HPD, > phy_stat & HDMI_PHY_RX_SENSE); > > - if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { > - mutex_lock(&hdmi->cec_notifier_mutex); > - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); > - mutex_unlock(&hdmi->cec_notifier_mutex); > - } > - > if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) && > (phy_stat & HDMI_PHY_HPD)) > status = connector_status_connected;
On 5/16/2026 9:07 PM, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [High] Moving CEC physical address invalidation exclusively to dw_hdmi_connector_detect breaks CEC functionality when dw_hdmi operates purely as a DRM bridge. > -- > > commit 05206110d2cbe02dc5e2cae3b6c3e7d2d8cdbe48 > Author: Jonas Karlman <jonas@kwiboo.se> > Subject: drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect > > This commit delays the CEC physical address invalidation from the IRQ > handler until the connector detect operation is called. > >> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> index 5fd26ff8f55b4..aae1b890167b1 100644 >> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> @@ -2472,7 +2472,17 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) >> { >> struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, >> connector); >> - return dw_hdmi_detect(hdmi); >> + enum drm_connector_status status; >> + >> + status = dw_hdmi_detect(hdmi); >> + >> + if (status == connector_status_disconnected) { >> + mutex_lock(&hdmi->cec_notifier_mutex); >> + cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); >> + mutex_unlock(&hdmi->cec_notifier_mutex); >> + } >> + >> + return status; >> } > > Does moving the invalidation exclusively to dw_hdmi_connector_detect break > CEC functionality when the hardware operates purely as a DRM bridge? No, hdmi->cec_notifier is going to be NULL when the hardware operates purely as a DRM bridge, CEC notifier was only created for the dw-hdmi connector prior to this series. Regards, Jonas > Before this change, cec_notifier_phys_addr_invalidate was called directly > from the hardware interrupt handler, guaranteeing execution on disconnect > regardless of how the driver was configured. > > In bridge-only mode, the connector is created externally and > dw_hdmi_connector_detect is never executed. The DRM core or downstream > component instead calls dw_hdmi_bridge_detect, which was not updated here > to include the CEC invalidation logic. The CEC physical address might not > be invalidated on unplug in bridge mode, which would be a regression. > > I see this is addressed later in the series by commit 795c172faddab (drm: > bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect()), but > this intermediate patch appears to introduce a functional regression that > might affect bisection. > > [ ... ] > >> @@ -3106,12 +3116,6 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) >> phy_stat & HDMI_PHY_HPD, >> phy_stat & HDMI_PHY_RX_SENSE); >> >> - if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { >> - mutex_lock(&hdmi->cec_notifier_mutex); >> - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); >> - mutex_unlock(&hdmi->cec_notifier_mutex); >> - } >> - >> if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) && >> (phy_stat & HDMI_PHY_HPD)) >> status = connector_status_connected; >
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 5fd26ff8f55b..aae1b890167b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2472,7 +2472,17 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); - return dw_hdmi_detect(hdmi); + enum drm_connector_status status; + + status = dw_hdmi_detect(hdmi); + + if (status == connector_status_disconnected) { + mutex_lock(&hdmi->cec_notifier_mutex); + cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); + mutex_unlock(&hdmi->cec_notifier_mutex); + } + + return status; } static int dw_hdmi_connector_get_modes(struct drm_connector *connector) @@ -3106,12 +3116,6 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) phy_stat & HDMI_PHY_HPD, phy_stat & HDMI_PHY_RX_SENSE); - if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { - mutex_lock(&hdmi->cec_notifier_mutex); - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); - mutex_unlock(&hdmi->cec_notifier_mutex); - } - if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) && (phy_stat & HDMI_PHY_HPD)) status = connector_status_connected;