From nobody Thu Oct 2 15:32:31 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBF7A2FB604 for ; Mon, 15 Sep 2025 10:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931248; cv=none; b=u7ZqyohRvcC0ydV3Vyos30mhMFKXKQGjCPqkUV/PIw2rcSDEyAu6arLsT15qOp9hqIV2CjQq5/uGKLT9kQwsgqiNgHLY02ADiuc8fxUSq6jdQ1HSTcDkiKWzgDyzjtsmfgyfWXP5OH1ZRjtL8CQwueMpLqLR4c0F9aF7HS19t3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931248; c=relaxed/simple; bh=49KEp8TvfXCVdIa8TD63bhrs5MUuVkTk7tNfPShLDwU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Pa0Zf0YTSYg6G0TwQKxzmbvc8l4+WPWqBI8Ax/mSamVcEC/1yLWNQcfuWFXlSennCkoWndstcBxB88tJH4xIRgNPvHntAALZ9ZpjjLPLIjQm6f3J01zVh/EH4MAv/Lb6PtQf2eFb8dIVk+KDmW7mBweb7AdvVdbhGv8vJUG+H0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=p/LGZc6W; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="p/LGZc6W" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 2DD751A0E13; Mon, 15 Sep 2025 10:14:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 027DF6063F; Mon, 15 Sep 2025 10:14:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 08D4B102F2ABA; Mon, 15 Sep 2025 12:14:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1757931242; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=IAUhZTmobCaS25Cb7JsVWxwF+BZlLMSGAaomRA5kzc0=; b=p/LGZc6WkYkiTaCZTgrE7LSqHbKK6b27BKPq3qvZA1L7MeqlRuKEfkiC76o0bhyGw4dOTg BFY8PrtOsTpuOX8/nqPSlSPLxBMZUVd+plB0mfWCLeE0avWhbS0iPRe91kQhKEwUemPxyP GL/5MJLj1lOEzTuYboSWOOUyIDCpJMX77WrySKGQC3/+WOZpDYMvHPaqVIcfKgnxusHI5Q Iuc9l2ftG/h06ZieZuCGtEtvRDHTNGSDuQ8wzGTo8Ma8okDlC8pDghXR/B3l6htj0ZeH+l k8o1m/C1FL3hV4+fd2Eg962cXMaL0x9Ke7fDoGDX3u4fMQeYtsdbGvChQOUuuA== From: Luca Ceresoli Date: Mon, 15 Sep 2025 12:12:46 +0200 Subject: [PATCH v9 1/3] drm/bridge: add list of removed refcounted bridges Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250915-drm-bridge-debugfs-removed-v9-1-6e5c0aff5de9@bootlin.com> References: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> In-Reply-To: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 Between drm_bridge_add() and drm_bridge_remove() bridges are registered to the DRM core via the global bridge_list and visible in /sys/kernel/debug/dri/bridges. However between drm_bridge_remove() and the last drm_bridge_put() memory is still allocated even though the bridge is not registered, i.e. not in bridges_list, and also not visible in debugfs. This prevents debugging refcounted bridges lifetime, especially leaks due to a missing drm_bridge_put(). In order to allow debugfs to also show the removed bridges, move such bridges into a new ad-hoc list until they are eventually freed. Note this requires adding INIT_LIST_HEAD(&bridge->list) in the bridge initialization code. The lack of such init was not exposing any bug so far, but it would with the new code, for example when a bridge is allocated and then freed without calling drm_bridge_add(), which is common on probe errors. drm_bridge_add() needs special care for bridges being added after having been previously added and then removed. This happens for example for many non-DCS DSI host bridge drivers like samsung-dsim which drm_bridge_add/remove() themselves every time the DSI device does a DSI attaches/detach. When the DSI device is hot-pluggable this happens multiple times in the lifetime of the DSI host bridge. On every attach after the first one, drm_bridge_add() finds bridge->list in the removed list, not at the initialized state as drm_bridge_add() currently expects. Add a list_del_init() to remove the bridge from the lingering list and bring bridge->list back to the initialized state. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v8: - split the documentation changes to a separate patch - rename "removed" to "lingering" - improve commits message about the special care needed for "un-removed" bridges Changes in v7: - rebase on current drm-misc-next - remove if (drm_bridge_is_refcounted(bridge)), refcounting is now mandatory - add check to detect when re-adding a bridge that is in the removed list - improve commit message - fix typo This patch was added in v6. --- drivers/gpu/drm/drm_bridge.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 5ec2ff77da79e51f614f98ebe58b6171c611867a..9491ae7c884d355be4a82fb02a4= 3a42d17fa8e0c 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -197,15 +197,22 @@ * driver. */ =20 +/* Protect bridge_list and bridge_lingering_list */ static DEFINE_MUTEX(bridge_lock); static LIST_HEAD(bridge_list); +static LIST_HEAD(bridge_lingering_list); =20 static void __drm_bridge_free(struct kref *kref) { struct drm_bridge *bridge =3D container_of(kref, struct drm_bridge, refco= unt); =20 + mutex_lock(&bridge_lock); + list_del(&bridge->list); + mutex_unlock(&bridge_lock); + if (bridge->funcs->destroy) bridge->funcs->destroy(bridge); + kfree(bridge->container); } =20 @@ -275,6 +282,7 @@ void *__devm_drm_bridge_alloc(struct device *dev, size_= t size, size_t offset, return ERR_PTR(-ENOMEM); =20 bridge =3D container + offset; + INIT_LIST_HEAD(&bridge->list); bridge->container =3D container; bridge->funcs =3D funcs; kref_init(&bridge->refcount); @@ -304,6 +312,14 @@ void drm_bridge_add(struct drm_bridge *bridge) =20 drm_bridge_get(bridge); =20 + /* + * If the bridge was previously added and then removed, it is now + * in bridge_lingering_list. Remove it or bridge_lingering_list will be + * corrupted when adding this bridge to bridge_list below. + */ + if (!list_empty(&bridge->list)) + list_del_init(&bridge->list); + mutex_init(&bridge->hpd_mutex); =20 if (bridge->ops & DRM_BRIDGE_OP_HDMI) @@ -357,7 +373,7 @@ void drm_bridge_remove(struct drm_bridge *bridge) br->funcs->bridge_event_notify(br, DRM_EVENT_BRIDGE_REMOVING, bridge); =20 mutex_lock(&bridge_lock); - list_del_init(&bridge->list); + list_move_tail(&bridge->list, &bridge_lingering_list); mutex_unlock(&bridge_lock); =20 mutex_destroy(&bridge->hpd_mutex); --=20 2.51.0 From nobody Thu Oct 2 15:32:31 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4904D2FB632 for ; Mon, 15 Sep 2025 10:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931250; cv=none; b=l+KnlYIWgRSX9dWOx8K+XAUH3BnA1CE1yrQwZvUSEAUP7ATXuuo18ZKNnEtPKke/AQf16ljq+6KTUjG77HbL+G+p9jOGBAxvvLGPfAOBcA8SDCOpNypsGj0dXVogz3hglkFwXm9KqOHAzo4QRqc5hParFSMkxM8kQEQjTNoAQKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931250; c=relaxed/simple; bh=ecPadECTbqy38SJJqaQ6PdYuKoRS8Wmn5VIsEo8/w/s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X0i971300n40KPmlzeF+H3iIZq2S8rl6QBIqgDBFo5DCHl3GZ9PfrEUZ7hEKt5dTKaMUwSi4PcBbsmYAb62E4IdqsYFXJgD1FkJ/tKiUehqc+IYVilUtT9QC05iH9YsJzeDB7xMJULUGXcd7F8GR6sy/j7o4giKouy9eSXmrIjM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=CtZTMnMU; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CtZTMnMU" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 37A2C4E40C32; Mon, 15 Sep 2025 10:14:06 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0CD9B6063F; Mon, 15 Sep 2025 10:14:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 32F1E102F2ABB; Mon, 15 Sep 2025 12:14:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1757931245; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=MxaPaKKWKs3ulFwyzozXHLb7YuQsngXreF1xvu2bmpo=; b=CtZTMnMU03MxTsrWXJ9NXMRSnC0dMIdN9ALKSTRBqUHAc7zlUv+xA2w7kfdoJKHwa/y5J/ 63Nq+cjEoHfO5MKZd0vlB6xyPwf2YDm0Y6UPJaI8JUqtVFpkcFfCGCtC0L+So0A2FDwZL0 W6+orSJQh/TbX17Trd9bW3xtJG3P/e3ymWii4/1pEQnuWsEEZiLrhauMYqDAkF6LrWk2bN WWBb7AqKUKtkOBN983pbMZebyzDH9mWONo2pFFbfZNbZ/KtKXTSTpUdQyzJRJHKuwyWkAw pzjxZnALiNY7i2jeKZbWzcZ9AnMXaAfbGg+mCsJwRZX8STxTrPqihKUtY/4Dsw== From: Luca Ceresoli Date: Mon, 15 Sep 2025 12:12:47 +0200 Subject: [PATCH v9 2/3] drm/debugfs: show lingering bridges Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250915-drm-bridge-debugfs-removed-v9-2-6e5c0aff5de9@bootlin.com> References: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> In-Reply-To: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 The usefulness of /sys/kernel/debug/dri/bridges is limited as it only shows bridges between drm_bridge_add() and drm_bridge_remove(). However refcounted bridges can stay allocated and lingering for a long time after drm_bridge_remove(), and a memory leak due to a missing drm_bridge_put() would not be visible in this debugfs file. Add lingering bridges to the /sys/kernel/debug/dri/bridges output. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v9: - rename leftover instances of "removed" to "lingering" Changes in v8: - updated to rename bridge_removed_list -> bridge_lingering_list Changes in v7: - rebased on current code which is in drm_bridge.c now - removed if (drm_bridge_is_refcounted(bridge)), refcounting is not optional - don't show bridge address - improve commit message This patch was added in v6. --- drivers/gpu/drm/drm_bridge.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 9491ae7c884d355be4a82fb02a43a42d17fa8e0c..dda4e641a38fa38cef16296366e= ea08fe8702618 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1491,17 +1491,20 @@ EXPORT_SYMBOL(devm_drm_put_bridge); =20 static void drm_bridge_debugfs_show_bridge(struct drm_printer *p, struct drm_bridge *bridge, - unsigned int idx) + unsigned int idx, + bool lingering) { drm_printf(p, "bridge[%u]: %ps\n", idx, bridge->funcs); =20 - drm_printf(p, "\trefcount: %u\n", kref_read(&bridge->refcount)); + drm_printf(p, "\trefcount: %u%s\n", kref_read(&bridge->refcount), + lingering ? " [lingering]" : ""); =20 drm_printf(p, "\ttype: [%d] %s\n", bridge->type, drm_get_connector_type_name(bridge->type)); =20 - if (bridge->of_node) + /* The OF node could be freed after drm_bridge_remove() */ + if (bridge->of_node && !lingering) drm_printf(p, "\tOF: %pOFfc\n", bridge->of_node); =20 drm_printf(p, "\tops: [0x%x]", bridge->ops); @@ -1527,7 +1530,10 @@ static int allbridges_show(struct seq_file *m, void = *data) mutex_lock(&bridge_lock); =20 list_for_each_entry(bridge, &bridge_list, list) - drm_bridge_debugfs_show_bridge(&p, bridge, idx++); + drm_bridge_debugfs_show_bridge(&p, bridge, idx++, false); + + list_for_each_entry(bridge, &bridge_lingering_list, list) + drm_bridge_debugfs_show_bridge(&p, bridge, idx++, true); =20 mutex_unlock(&bridge_lock); =20 @@ -1542,7 +1548,7 @@ static int encoder_bridges_show(struct seq_file *m, v= oid *data) unsigned int idx =3D 0; =20 drm_for_each_bridge_in_chain_scoped(encoder, bridge) - drm_bridge_debugfs_show_bridge(&p, bridge, idx++); + drm_bridge_debugfs_show_bridge(&p, bridge, idx++, false); =20 return 0; } --=20 2.51.0 From nobody Thu Oct 2 15:32:31 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C71422FB601 for ; Mon, 15 Sep 2025 10:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931251; cv=none; b=NKW4/BOEBSbu7hAwxgpZx8+svFe9vFyU3ud6rf5Dut17VjlST1z0H9vwbvIH28esnDItg1hzSr8OYt1p2qKIgkOWqJ7f7yseHXdkbabw2mJDIq+RwWt5/BvHKcfwTXwtP7czxiaDA/9tRVY0+8VX/HtUu6rF1SaN00Oc418MCP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757931251; c=relaxed/simple; bh=wc5TUXJ0T6obVvbOtZGrI+LHe8XU4yLo4f+LXuPnE8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VxkzeJpU8LbqBMK+7J0XQZlii+ZLazRY0BBK8z/THlfrWzrQECdPsLLROQFlt11KM6n4BYEUKKiEZnz+C1VQYsAaQWlPjzwIKDsHDV6IazFwHUGQb7UOwuGLsDRDBbPlT2TQivsAgY3AYWjGDYu0EoTiQX/Zy8XpolVpvaqqK7s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=fjDASGvl; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fjDASGvl" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 22FAB4E40C35; Mon, 15 Sep 2025 10:14:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id EB9656063F; Mon, 15 Sep 2025 10:14:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7A064102F2AA2; Mon, 15 Sep 2025 12:14:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1757931247; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=J9/AgKGIATQBdVyJoqM+e9KL7AMFzerN17q6UT9Xda4=; b=fjDASGvlNTRDGF29veJE/I+msnzzs0t7B/U55qcHiFayGzigavx7iKdPms0psCwGt3ajT8 u25jAzL2lU1B6JfM0eZ94GmiLBv2egYtuB7uN55Y2i/4yYvQxCZnKtwcoG3SqSU02fK05t ohz1hJeBJEb4fhCRqON+kLqP8dmmIXwKxO5Wkns0YsHPGRNeVmVmUd7ipFwTxPyHjKX4cz AJ8ssXG8EcCw3TcAgL4JROsDkcxu+RM21OQ9BPlGoS5/NEnrjXD1Vq+QAPeP18Kw9rB1E6 ShzXEuZ9EdwCkXp/M6MwqrX2B1WAp11qP0rAQgeH8jBNbPqpHqskcyokgyIi3Q== From: Luca Ceresoli Date: Mon, 15 Sep 2025 12:12:48 +0200 Subject: [PATCH v9 3/3] drm/bridge: adapt drm_bridge_add/remove() docs, mention the lingering list Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250915-drm-bridge-debugfs-removed-v9-3-6e5c0aff5de9@bootlin.com> References: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> In-Reply-To: <20250915-drm-bridge-debugfs-removed-v9-0-6e5c0aff5de9@bootlin.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 The role of drm_bridge_add/remove() is more complex now after having added the lingering list. Update the kdoc accordingly. Also stop mentioning the global list(s) in the first line of the docs: the most important thing to mention here is that bridges are registered and deregistered, lists are just the type of container used to implement such (de)registration. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v8: - extracted to an ad-hoc patch from the v7 patch "drm/bridge: add list of removed refcounted bridges" --- drivers/gpu/drm/drm_bridge.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index dda4e641a38fa38cef16296366eea08fe8702618..10267d3903ea12f19308376d83d= 432637c26ae76 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -296,10 +296,13 @@ void *__devm_drm_bridge_alloc(struct device *dev, siz= e_t size, size_t offset, EXPORT_SYMBOL(__devm_drm_bridge_alloc); =20 /** - * drm_bridge_add - add the given bridge to the global bridge list + * drm_bridge_add - register a bridge * * @bridge: bridge control structure * + * Add the given bridge to the global list of bridges, where they can be + * found by users via of_drm_find_bridge(). + * * The bridge to be added must have been allocated by * devm_drm_bridge_alloc(). */ @@ -360,9 +363,14 @@ int devm_drm_bridge_add(struct device *dev, struct drm= _bridge *bridge) EXPORT_SYMBOL(devm_drm_bridge_add); =20 /** - * drm_bridge_remove - remove the given bridge from the global bridge list + * drm_bridge_remove - unregister a bridge * * @bridge: bridge control structure + * + * Remove the given bridge from the global list of registered bridges, so + * it won't be found by users via of_drm_find_bridge(), and add it to the + * lingering bridge list, to keep track of it until its allocated memory is + * eventually freed. */ void drm_bridge_remove(struct drm_bridge *bridge) { --=20 2.51.0