| Message ID | 20260516183838.2024991-15-jonas@kwiboo.se (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-23416-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 0D8581C0085 for <noreply@patchwork.local>; Sat, 16 May 2026 20:51:29 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=kwiboo.se; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-23416-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-23416-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 01B40301BCC0 for <noreply@patchwork.local>; Sat, 16 May 2026 18:42:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A02C1405C57; Sat, 16 May 2026 18:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="eadPxfOT" X-Original-To: linux-sunxi@lists.linux.dev Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (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 52E512F1FD7 for <linux-sunxi@lists.linux.dev>; Sat, 16 May 2026 18:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778956959; cv=none; b=nnLtE2oK7wseIvwgG8e+Yqq/MquEhlSeuDqHbjkA/7miHoUDmd+ir8tq7i9991bMxayDU4ZPRBBGoEnX3ZIbBK+diE2zy1auAiOKKVX9XLspqpgKFMaaXV+qk4xm2g8JIykmcekC7YckAPiyzibu+H+pOT7FcSSdnIQ6yi6nA1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778956959; c=relaxed/simple; bh=nTOl+0wmbj6DoxgllvsuJQRuCtKzqm3lSTm6w5topqs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q9CeoGmO+ZHYWekwe0S+bP67znHGpgOJg5ZG/g2zJ8jvdCTqWTwTmPgFmYLkcHEjUI6zOVD3uK+KimviNQqayodKz9x/EbN9UXsRgJ2c4W7sNdZIMv1XiIuem8eEvUmR3VvuKNSTjOb2v/j5J6nOI25+/3mvjDjwz4fi3LGSYzo= 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=eadPxfOT; arc=none smtp.client-ip=149.28.215.223 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=1778956956; bh=w9gLcIjrWFUo1B9oSiBZ5ajnppXXlJddCFjM0GCTYiM=; b=eadPxfOT5NRco3ewpTs4kdyzaNk35fgV0iYOdNORlJD1nA+xf6PtRuxAE1n8f695K7vhNCLH4 aNqfuFWeT8Qo8DFCRsUqOT17hdMsifvfvjxOD6W6pcJ3TnZwTr8HFRo+HOmy2KFGcWykIcTUQlH OZbycEBHabU+KU2C8euLhxJIlLWkwr+8YIe5h+/VCGip4Q3tm5VnRqmbFe6WwaZ44BkJg3bDaJB ydp/UXmh+dZJomvRtxpS3a/QBzG1IAwV6ccUQjw4F+ioBEE6jYjI7Q+Q64k07efw1L/HsovZzpn KK5lCDWbT4jU7Nd+JXGYzYAfyLcLGaoU40fsHbBeB70g== X-Forward-Email-ID: 6a08b9f079c7625f20eeee89 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 <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 14/22] drm: bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect() Date: Sat, 16 May 2026 18:38:24 +0000 Message-ID: <20260516183838.2024991-15-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-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
Update EDID and CEC phys addr in the bridge detect() func to closely
match the behavior of a bridge connector with a HDMI bridge attached
and the dw-hdmi connector.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
v6: New patch
This is a temporary change until dw-hdmi is fully converted into a
HDMI bridge in a future part of this multi-series effort.
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Comments
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Redundant, back-to-back EDID reads over I2C causing significant latency during probe. - [High] Unchecked return value from `drm_edid_raw()` causes a NULL pointer dereference on malformed EDIDs. -- commit 795c172faddaba022a4fd3aecfe0898f0291550f Author: Jonas Karlman <jonas@kwiboo.se> drm: bridge: dw_hdmi: Update EDID and CEC phys addr in bridge detect() This commit updates the EDID and CEC physical address in the bridge detect() function. This is intended to closely match the behavior of a bridge connector with an HDMI bridge attached and the dw-hdmi connector. > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 2bb043d64b658..3649ccf8d994e 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -2969,8 +2969,17 @@ static enum drm_connector_status > dw_hdmi_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector) > { > struct dw_hdmi *hdmi = bridge->driver_private; > + enum drm_connector_status status; > + > + status = dw_hdmi_detect(hdmi); > + > + /* > + * Update EDID and CEC phys addr to match the behavior of a bridge > + * connector with a HDMI bridge attached and the dw-hdmi connector. > + */ > + dw_hdmi_connector_status_update(hdmi, connector, status); Does this cause redundant EDID reads over I2C during probe? Because the driver does not set DRM_BRIDGE_OP_HDMI, the DRM core bridge framework (drm_bridge_connector_get_modes_edid) is unaware of this EDID update. Consequently, during a standard modeset probe, the core framework calls detect() again and then edid_read(), resulting in up to three separate I2C EDID reads per probe cycle (one from initial detect, one from get_modes detect, and one from get_modes edid_read). Since DDC reads are slow, could this cause a latency regression? Additionally, could calling dw_hdmi_connector_status_update() here trigger a NULL pointer dereference on malformed EDIDs? dw_hdmi_connector_status_update() calls dw_hdmi_edid_read(), which unconditionally calls drm_edid_raw() and dereferences the result. However, drm_edid_raw() can return NULL for malformed EDIDs where the extension count indicates a size larger than the read buffer. While this behavior existed previously, hooking the EDID read into the detect() callback makes this bug significantly more reachable. Could this cause a kernel panic simply by connecting a monitor with a malformed EDID on hotplug? > > - return dw_hdmi_detect(hdmi); > + return status; > }
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 2bb043d64b65..3649ccf8d994 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2969,8 +2969,17 @@ static enum drm_connector_status dw_hdmi_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector) { struct dw_hdmi *hdmi = bridge->driver_private; + enum drm_connector_status status; - return dw_hdmi_detect(hdmi); + status = dw_hdmi_detect(hdmi); + + /* + * Update EDID and CEC phys addr to match the behavior of a bridge + * connector with a HDMI bridge attached and the dw-hdmi connector. + */ + dw_hdmi_connector_status_update(hdmi, connector, status); + + return status; } static const struct drm_edid *dw_hdmi_bridge_edid_read(struct drm_bridge *bridge,