| Message ID | 20260518180206.2480119-10-jonas@kwiboo.se (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-23512-sunxi=pue.re@lists.linux.dev> 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 996251C0029 for <noreply@patchwork.local>; Mon, 18 May 2026 20:04:21 +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-23512-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-23512-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 8C110304ADE4 for <noreply@patchwork.local>; Mon, 18 May 2026 18:03:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A592F305675; Mon, 18 May 2026 18:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="l8xDgENk" X-Original-To: linux-sunxi@lists.linux.dev Received: from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.66]) (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 111633803C5 for <linux-sunxi@lists.linux.dev>; Mon, 18 May 2026 18:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=121.127.44.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779127378; cv=none; b=AoKj8zMC/jkKTd4ejrGmWxZ/Lib7krIQ6aRR7J1n2Tu24eJg85agS1pQ3373hnn1fD9wa5OAWYcYLNQ4I6c3/vvHbezO2KoHEftJvBNSHHHBlwS65gWwCHTqRrUrybAUO003+k+NIF44ZbbBorKP8x7xv6LM7TPhpfn9/F8huCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779127378; c=relaxed/simple; bh=gJ9Ym4SEBXPrg9rbf03paHyAyTACieHc3kewtWnsqoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JHez75iwdsKKE8vHBpeNtj0TL7+fSByf+d/+KMLoaGRXrahcoRvWeXL7NYcaUhfmY3s82qbXlNE0L/afuphsT3bkXa6UPqs2aw4Mp/355GJpu4j7P+8VHy4gIwSL9qI1O21DASuYOWtI5j/V1zasIQqSEs7ttbghH/ToleV/Aao= 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=l8xDgENk; arc=none smtp.client-ip=121.127.44.66 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=1779127376; bh=y1qusCJrJS8qT16e2pU+cznjnv8NM8UAIVFu7XIBUj8=; b=l8xDgENk0Ffz8bvIvEvFbkJYjwVKmsyNLNSs95YuQEmKjx54Yh4eDrPUZzFz6xmoHHsXs7Jyy MTCujYuB30sLmtz4vEsNImt5Eg2UUonHN9TPiqENTRgPvrVT4vYzame7oRF94hjd1CsEU7DDB3x DVrG7a+VtVeuL+d0PQEJVx8155O8u1KxhGN9HsIkzMFPB9X1yLSuCdAYAdq7P85M+xlHi9fcD/F /C4SvcUlLRVnlzxWFXgVTcN0lHcuo5A0Q8OiTx+/IUGTK1DuDj78D3hmtUeXN80SFYNOX8nCFq7 ERol6XF21hAycjGYN2qOfd1T+NT1MzxstPDSpooIpscg== X-Forward-Email-ID: 6a0b544cb84dbc72d2274e87 X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.66 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 v7 09/23] drm: bridge: dw_hdmi: Unregister CEC notifier during connector cleanup Date: Mon, 18 May 2026 18:01:45 +0000 Message-ID: <20260518180206.2480119-10-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> 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 18, 2026, 6:01 p.m. UTC
The CEC notifier is being unregistered when the bridge detach, something that happens earlier than normal connector cleanup. Change to unregister the CEC notifier at connector cleanup, in the connector .destroy() func, to align the lifetime of the connector and the CEC notifier and closer match a drmres handled generic CEC notifier. Tested-by: Diederik de Haas <diederik@cknow-tech.com> # Rock64, RockPro64, Quartz64-B Signed-off-by: Jonas Karlman <jonas@kwiboo.se> --- v7: No change v6: Collect t-b tag v5: New patch --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
Comments
On 18/05/2026 20:01, Jonas Karlman wrote: > The CEC notifier is being unregistered when the bridge detach, > something that happens earlier than normal connector cleanup. > > Change to unregister the CEC notifier at connector cleanup, in the > connector .destroy() func, to align the lifetime of the connector and > the CEC notifier and closer match a drmres handled generic CEC notifier. > > Tested-by: Diederik de Haas <diederik@cknow-tech.com> # Rock64, RockPro64, Quartz64-B > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org> Regards, Hans > --- > v7: No change > v6: Collect t-b tag > v5: New patch > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index cbbd15578042..5fd26ff8f55b 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -2532,6 +2532,11 @@ static void dw_hdmi_connector_destroy(struct drm_connector *connector) > { > struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); > > + mutex_lock(&hdmi->cec_notifier_mutex); > + cec_notifier_conn_unregister(hdmi->cec_notifier); > + hdmi->cec_notifier = NULL; > + mutex_unlock(&hdmi->cec_notifier_mutex); > + > drm_connector_cleanup(connector); > drm_bridge_put(&hdmi->bridge); > } > @@ -2909,16 +2914,6 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, > return dw_hdmi_connector_create(hdmi); > } > > -static void dw_hdmi_bridge_detach(struct drm_bridge *bridge) > -{ > - struct dw_hdmi *hdmi = bridge->driver_private; > - > - mutex_lock(&hdmi->cec_notifier_mutex); > - cec_notifier_conn_unregister(hdmi->cec_notifier); > - hdmi->cec_notifier = NULL; > - mutex_unlock(&hdmi->cec_notifier_mutex); > -} > - > static enum drm_mode_status > dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_info *info, > @@ -2996,7 +2991,6 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { > .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, > .atomic_reset = drm_atomic_helper_bridge_reset, > .attach = dw_hdmi_bridge_attach, > - .detach = dw_hdmi_bridge_detach, > .atomic_check = dw_hdmi_bridge_atomic_check, > .atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts, > .atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,
On Mon, 18 May 2026 18:01:45 +0000, Jonas Karlman <jonas@kwiboo.se> wrote: > The CEC notifier is being unregistered when the bridge detach, > something that happens earlier than normal connector cleanup. > > Change to unregister the CEC notifier at connector cleanup, in the > connector .destroy() func, to align the lifetime of the connector and > the CEC notifier and closer match a drmres handled generic CEC notifier. > > [...] Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index cbbd15578042..5fd26ff8f55b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2532,6 +2532,11 @@ static void dw_hdmi_connector_destroy(struct drm_connector *connector) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); + mutex_lock(&hdmi->cec_notifier_mutex); + cec_notifier_conn_unregister(hdmi->cec_notifier); + hdmi->cec_notifier = NULL; + mutex_unlock(&hdmi->cec_notifier_mutex); + drm_connector_cleanup(connector); drm_bridge_put(&hdmi->bridge); } @@ -2909,16 +2914,6 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, return dw_hdmi_connector_create(hdmi); } -static void dw_hdmi_bridge_detach(struct drm_bridge *bridge) -{ - struct dw_hdmi *hdmi = bridge->driver_private; - - mutex_lock(&hdmi->cec_notifier_mutex); - cec_notifier_conn_unregister(hdmi->cec_notifier); - hdmi->cec_notifier = NULL; - mutex_unlock(&hdmi->cec_notifier_mutex); -} - static enum drm_mode_status dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info, @@ -2996,7 +2991,6 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, .attach = dw_hdmi_bridge_attach, - .detach = dw_hdmi_bridge_detach, .atomic_check = dw_hdmi_bridge_atomic_check, .atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts, .atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,