The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	 Simona Vetter <simona@ffwll.ch>,
	Hui Pu <Hui.Pu@gehealthcare.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Dmitry Baryshkov <lumag@kernel.org>
Subject: Re: [PATCH v8 2/3] drm/debugfs: show removed bridges
Date: Mon, 15 Sep 2025 10:12:38 +0200	[thread overview]
Message-ID: <20250915-whimsical-kickass-snake-ebb4dd@penduick> (raw)
In-Reply-To: <20250912-drm-bridge-debugfs-removed-v8-2-5c33d87ccb55@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

On Fri, Sep 12, 2025 at 07:03:42PM +0200, Luca Ceresoli wrote:
> 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 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 removed bridges to the /sys/kernel/debug/dri/bridges output.
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 
> ---
> 
> 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..fccc42017fd4df6ecfb596325df2dc4d17566f39 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);
>  
>  static void drm_bridge_debugfs_show_bridge(struct drm_printer *p,
>  					   struct drm_bridge *bridge,
> -					   unsigned int idx)
> +					   unsigned int idx,
> +					   bool removed)
>  {
>  	drm_printf(p, "bridge[%u]: %ps\n", idx, bridge->funcs);
>  
> -	drm_printf(p, "\trefcount: %u\n", kref_read(&bridge->refcount));
> +	drm_printf(p, "\trefcount: %u%s\n", kref_read(&bridge->refcount),
> +		   removed ? " [removed]" : "");

I would use lingering here too, and your commit logs haven't been
updated either.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2025-09-15  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12 17:03 [PATCH v8 0/3] drm/bridge: debugfs: show refcount and list removed bridges Luca Ceresoli
2025-09-12 17:03 ` [PATCH v8 1/3] drm/bridge: add list of removed refcounted bridges Luca Ceresoli
2025-09-12 17:03 ` [PATCH v8 2/3] drm/debugfs: show removed bridges Luca Ceresoli
2025-09-15  8:12   ` Maxime Ripard [this message]
2025-09-12 17:03 ` [PATCH v8 3/3] drm/bridge: adapt drm_bridge_add/remove() docs, mention the lingering list Luca Ceresoli
2025-09-15  8:13 ` [PATCH v8 0/3] drm/bridge: debugfs: show refcount and list removed bridges Maxime Ripard
2025-09-15 10:30   ` Luca Ceresoli
2025-09-15 12:23     ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250915-whimsical-kickass-snake-ebb4dd@penduick \
    --to=mripard@kernel.org \
    --cc=Hui.Pu@gehealthcare.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox