From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>,
Ian Ray <ian.ray@ge.com>,
Martyn Welch <martyn.welch@collabora.co.uk>,
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>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Archit Taneja <architt@codeaurora.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3 3/3] drm/bridge: megachips: remove bridge when irq request fails
Date: Thu, 30 Apr 2026 22:00:37 +0200 [thread overview]
Message-ID: <afO05Q3tPgifoqvz@osama> (raw)
In-Reply-To: <DI5M5PFEHAD8.2IO9A5HABWOK6@bootlin.com>
Hello Luca,
On Wed, Apr 29, 2026 at 01:48:33PM +0200, Luca Ceresoli wrote:
> On Thu Apr 23, 2026 at 10:06 PM CEST, Osama Abdelkader wrote:
> > If devm_request_threaded_irq() fails after drm_bridge_add(), remove the
> > bridge before returning.
> >
> > Keep drm_bridge_add() rather than devm_drm_bridge_add(): registration is
> > tied to the STDP4028 device while ge_b850v3_register() may complete from
> > either I2C probe; devm would not unwind the bridge if the other client's
> > probe fails.
> >
> > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> > Fixes: a68ee76f4a28 ("drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: Fix bridge initialization")
>
> That commit only moved the bug to a slightly different location. The bug
> was present even before, since commit fcfa0ddc18ed ("drm/bridge: Drivers
> for megachips-stdpxxxx-ge-b850v3-fw (LVDS-DP++)"), so you should update
> your Fixes line to point to it.
Updated in v4, thanks.
>
>
> > Cc: stable@vger.kernel.org
> > ---
> > v3: add Fixes and Cc tags
> > v2: IRQ failure path only (explicit drm_bridge_remove)
> > ---
> > .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 16 ++++++++++------
> > 1 file changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> > index c9e6505cbd88..2d02cc69f237 100644
> > --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> > +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> > @@ -251,7 +251,6 @@ static void ge_b850v3_lvds_remove(void)
> > goto out;
> >
> > drm_bridge_remove(&ge_b850v3_lvds_ptr->bridge);
> > -
> > ge_b850v3_lvds_ptr = NULL;
> > out:
> > mutex_unlock(&ge_b850v3_lvds_dev_mutex);
> > @@ -261,6 +260,7 @@ static int ge_b850v3_register(void)
> > {
> > struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
> > struct device *dev = &stdp4028_i2c->dev;
> > + int ret;
> >
> > /* drm bridge initialization */
> > ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT |
> > @@ -277,11 +277,15 @@ static int ge_b850v3_register(void)
> > if (!stdp4028_i2c->irq)
> > return 0;
> >
> > - return devm_request_threaded_irq(&stdp4028_i2c->dev,
> > - stdp4028_i2c->irq, NULL,
> > - ge_b850v3_lvds_irq_handler,
> > - IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> > - "ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
> > + ret = devm_request_threaded_irq(&stdp4028_i2c->dev,
> > + stdp4028_i2c->irq, NULL,
> > + ge_b850v3_lvds_irq_handler,
> > + IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> > + "ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
> > + if (ret)
> > + drm_bridge_remove(&ge_b850v3_lvds_ptr->bridge);
>
> Why not just using devm_drm_bridge_add() and keep everything else clean, as
> you did in other patches in the series?
Because registration is tied to the STDP4028 device while ge_b850v3_register()
may complete from either I2C probe; so devm would not unwind the bridge if the
other client's probe fails.
>
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
next prev parent reply other threads:[~2026-04-30 20:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 20:06 [PATCH v3 1/3] drm/sti: remove bridge when sti_hda component_add fails Osama Abdelkader
2026-04-23 20:06 ` [PATCH v3 2/3] drm/exynos: remove bridge when " Osama Abdelkader
2026-04-29 11:43 ` Luca Ceresoli
2026-05-04 20:47 ` Raphaël Gallais-Pou
2026-04-23 20:06 ` [PATCH v3 3/3] drm/bridge: megachips: remove bridge when irq request fails Osama Abdelkader
2026-04-29 11:48 ` Luca Ceresoli
2026-04-30 20:00 ` Osama Abdelkader [this message]
2026-04-29 11:42 ` [PATCH v3 1/3] drm/sti: remove bridge when sti_hda component_add fails Luca Ceresoli
2026-04-29 13:40 ` Raphaël Gallais-Pou
2026-05-04 20:58 ` Raphael Gallais-Pou
2026-05-05 14:57 ` (subset) " 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=afO05Q3tPgifoqvz@osama \
--to=osama.abdelkader@gmail.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.ray@ge.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=martyn.welch@collabora.co.uk \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=peter.senna@gmail.com \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--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