From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Maxime Ripard <mripard@kernel.org>,
dri-devel@lists.freedesktop.org,
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>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Douglas Anderson <dianders@chromium.org>,
Damon Ding <damon.ding@rock-chips.com>
Subject: Re: [PATCH] drm/bridge: analogix_dp: Use devm_drm_bridge_alloc() API
Date: Mon, 7 Jul 2025 12:25:56 +0200 [thread overview]
Message-ID: <20250707122556.22c6f57f@booty> (raw)
In-Reply-To: <4e37e409-9e87-4e49-a296-9006fd552a5d@samsung.com>
Hi Marek, Maxime,
On Mon, 7 Jul 2025 12:12:51 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> On 07.07.2025 11:21, Maxime Ripard wrote:
> > On Thu, Jul 03, 2025 at 05:50:32PM +0200, Luca Ceresoli wrote:
> >> On Tue, 1 Jul 2025 16:27:54 +0200
> >> Maxime Ripard <mripard@kernel.org> wrote:
> >>
> >>> On Tue, Jul 01, 2025 at 04:02:19PM +0200, Luca Ceresoli wrote:
> >>>> Hello Marek, Maxime,
> >>>>
> >>>> thanks Marek for spotting the issue and sending a patch!
> >>>>
> >>>> On Mon, 30 Jun 2025 18:44:24 +0200
> >>>> Maxime Ripard <mripard@kernel.org> wrote:
> >>>>
> >>>>>> @@ -1643,7 +1625,7 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
> >>>>>> return ret;
> >>>>>> }
> >>>>>>
> >>>>>> - ret = analogix_dp_create_bridge(drm_dev, dp);
> >>>>>> + ret = drm_bridge_attach(dp->encoder, &dp->bridge, NULL, 0);
> >>>>>> if (ret) {
> >>>>>> DRM_ERROR("failed to create bridge (%d)\n", ret);
> >>>>>> goto err_unregister_aux;
> >>>>> It looks like you don't set bridge->driver_private anymore. Is it on purpose?
> >>>> This looks correct to me. In current code, driver_private is used to
> >>>> hold a pointer to the driver private struct (struct
> >>>> analogix_dp_device). With devm_drm_bridge_alloc() container_of() is now
> >>>> enough, no pointer is needed. With the patch applied, driver_private
> >>>> becomes unused.
> >>> Then we should remove it from the structure if it's unused.
> >> Makes sense now that struct drm_bridge is meant to be always embedded
> >> in a driver-private struct. But several drivers are still using it, so
> >> those would need to be updated beforehand:
> >>
> >> $ git grep -l driver_private -- drivers/gpu/drm/ | wc -l
> >> 23
> >> $
> > Ah, you're right, sorry for the noise.
> >
> >> So I think this patch should be taken as it fixes a regression. Do you
> >> agree on this?
> > As far as I know, that commit only exists in drm-misc-next. Also, it
> > should have a Fixes tag.
>
> I wasn't sure which commit should be listed as Fixes tag in this case.
> The mentioned 9c399719cfb9 ("drm: convert many bridge drivers from
> devm_kzalloc() to devm_drm_bridge_alloc() API")?
Despite being somewhat orthogonal, I think it should be commit
a7748dd127ea ("drm/bridge: get/put the bridge reference in
drm_bridge_add/remove()") just because it is the very first commit in
the drm-misc-next history introducing a get/put pair, and thus
triggering the refcount warning.
I'm applying with that added.
Thanks both for the discussion.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-07-07 10:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250627165702eucas1p12dbc50fea261d6846e67880bbef5c564@eucas1p1.samsung.com>
2025-06-27 16:56 ` [PATCH] drm/bridge: analogix_dp: Use devm_drm_bridge_alloc() API Marek Szyprowski
2025-06-30 16:44 ` Maxime Ripard
2025-07-01 14:02 ` Luca Ceresoli
2025-07-01 14:27 ` Maxime Ripard
2025-07-03 15:50 ` Luca Ceresoli
2025-07-07 9:07 ` Marek Szyprowski
2025-07-07 10:59 ` Luca Ceresoli
2025-07-08 14:19 ` Luca Ceresoli
2025-07-09 9:24 ` Maxime Ripard
2025-07-07 9:21 ` Maxime Ripard
2025-07-07 10:12 ` Marek Szyprowski
2025-07-07 10:25 ` Luca Ceresoli [this message]
2025-07-07 10:50 ` Luca Ceresoli
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=20250707122556.22c6f57f@booty \
--to=luca.ceresoli@bootlin.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=damon.ding@rock-chips.com \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.