From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
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>,
Inki Dae <inki.dae@samsung.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Dmitry Baryshkov <lumag@kernel.org>,
Hui Pu <Hui.Pu@gehealthcare.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-sunxi@lists.linux.dev, Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 00/32] drm/mipi-dsi: avoid DSI host drivers to have pointers to DSI devices
Date: Mon, 14 Jul 2025 17:28:45 +0200 [thread overview]
Message-ID: <20250714172845.1432972f@booty> (raw)
In-Reply-To: <20250707121319.1e40a73a@booty>
Hi Maxime,
On Mon, 7 Jul 2025 12:13:19 +0200
Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
...
> > Post scriptum. The very initial issue that led to all this discussion
> > when writing the hotplug-bridge driver is that the samsung-dsim driver
> > will not drm_bridge_add() until a DSI device does .attach to it. Again,
> > see the comments before hotplug_bridge_dsi_attach() in [0] for details.
> > However by re-examining the driver for the N-th time now from a new
> > POV, I _think_ this is not correct and potentially easy to solve. But this leads to one fundamental question:
>
> The question is: should a DSI host bridge driver:
>
> A) wait for a DSI device to .attach before drm_bridge_add()ing itself,
> or
> B) drm_bridge_add() itself unconditionally, and let the DSI device
> .attach whenever it happens?
>
> A) is what many drivers (IIRC the majority) does. It implies the card
> will not be populated until .attach, which in the hotplug case could
> happen very late
>
> B) is done by a few drivers and allows the card to appear in the
> hotplug case without the device, which is needed for hotplug.
I haven't received any reply to this e-mail. Should this be due to the
fuzzyness of what I wrote, you're perfectly understood. :-)
Let me try to start cleaner, and focus only on the question quoted here
above. It is very relevant to the hotplug work, so I'd like any informed
opinions about it in the first place. Many other things depend on it.
The samsung-dsim driver, which is in the hardware I'm working on, falls
in the A) case, and this is problematic.
> I had tried simply moving drm_bridge_add() from .attach to probe in
> the samsung-dsim driver in the pase but that would not work. Now I did
> yet another check at the code and I suspect it can be done with a small
> additional change, but cannot access the hardware to test it currently.
I managed to try today and test on hardware, and I can confirm that the
samsung-dsim driver can be moved from A) to B). In other words the
drm_bridge_add() call to add the samsung-dsim bridge can be moved from
the mipi_dsi_host_ops.attach op to the probe function, but this
requires an additional change, at least when using the imx8mp LCDIF:
@@ -1645,6 +1645,9 @@ static int samsung_dsim_attach(struct drm_bridge *bridge,
{
struct samsung_dsim *dsi = bridge_to_dsi(bridge);
+ if (!dsi->out_bridge)
+ return -EPROBE_DEFER;
+
return drm_bridge_attach(encoder, dsi->out_bridge, bridge,
flags);
}
Without the above change, the mxsfb driver will hard-fail because
mxsfb_attach_bridge() [0] finds the next bridge (the samsung-dsim
bridge, which is now added earlier, in probe) but cannot attach it to
the encoder chain (the samsung-dsim bridge still hasn't got an
out_bridge).
I have a working draft of the above samsung-dsim changes working with
the hotplug-bridge, and it makes the hotplug code one relevant step
simpler.
Your opinion would be appreciated before I proceed to cleaning up and
sending such change.
[0] https://elixir.bootlin.com/linux/v6.16-rc5/source/drivers/gpu/drm/mxsfb/mxsfb_drv.c#L128-L145
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-07-14 15:28 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 16:45 [PATCH 00/32] drm/mipi-dsi: avoid DSI host drivers to have pointers to DSI devices Luca Ceresoli
2025-06-25 16:45 ` [PATCH 01/32] drm/mipi-dsi: add sanity check of lane number in mipi_dsi_attach() Luca Ceresoli
2025-06-25 16:45 ` [PATCH 02/32] drm/hisilicon/kirin: remove redundant lanes number check Luca Ceresoli
2025-06-25 16:45 ` [PATCH 03/32] drm/bridge: nwl-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 04/32] drm/mcde: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 05/32] drm/mipi-dsi: log DSI device attach and detach Luca Ceresoli
2025-06-25 16:45 ` [PATCH 06/32] drm/bridge: samsung-dsim: remove redundant logging Luca Ceresoli
2025-06-25 16:45 ` [PATCH 07/32] drm/bridge: nwl-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 08/32] drm/bridge: cdns-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 09/32] drm/mcde: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 10/32] drm/sun4i: dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 11/32] drm/bridge: synopsys/dsi2: remove DSI device pointer from private callbacks Luca Ceresoli
2025-06-25 16:45 ` [PATCH RFC 12/32] drm/meson: dsi: remove unneeded DSI device check Luca Ceresoli
2025-06-25 16:45 ` [PATCH 13/32] drm/mipi-dsi: move format define above Luca Ceresoli
2025-06-25 16:45 ` [PATCH 14/32] drm/mipi-dsi: add .attach_new to mipi_dsi_host_ops Luca Ceresoli
2025-06-25 16:45 ` [PATCH 15/32] drm: adp: mipi: convert to the .attach_new op Luca Ceresoli
2025-06-25 16:45 ` [PATCH 16/32] drm/kmb: dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 17/32] drm/i915/dsi: " Luca Ceresoli
2025-06-25 18:42 ` Jani Nikula
2025-06-25 16:45 ` [PATCH 18/32] drm/hisilicon/kirin: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 19/32] drm/bridge: synopsys/dsi2: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 20/32] drm/msm/dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 21/32] drm/rcar-du: dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 22/32] drm: renesas: rz-du: rzg2l_mipi_dsi: " Luca Ceresoli
2025-06-26 23:42 ` kernel test robot
2025-06-25 16:45 ` [PATCH 23/32] drm/vc4: dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 24/32] drm/mediatek: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 25/32] drm/bridge: nwl-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 26/32] drm/bridge: cdns-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 27/32] drm/bridge: tc358768: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 28/32] drm/sprd: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 29/32] drm/bridge: synopsys: dw-mipi-dsi: " Luca Ceresoli
2025-06-25 16:45 ` [PATCH 30/32] drm/mcde: store a pointer to mipi_dsi_host to perform TE requests Luca Ceresoli
2025-06-25 16:45 ` [PATCH 31/32] drm/mcde: use the DSI host pointer in mcde_dsi_irq Luca Ceresoli
2025-06-25 16:45 ` [PATCH 32/32] drm/mcde: convert to the .attach_new op Luca Ceresoli
2025-07-07 6:16 ` [PATCH 00/32] drm/mipi-dsi: avoid DSI host drivers to have pointers to DSI devices Maxime Ripard
2025-07-07 9:58 ` Luca Ceresoli
2025-07-07 10:13 ` Luca Ceresoli
2025-07-14 15:28 ` Luca Ceresoli [this message]
2025-07-25 15:22 ` Maxime Ripard
2025-07-25 15:32 ` Luca Ceresoli
2025-07-25 15:17 ` 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=20250714172845.1432972f@booty \
--to=luca.ceresoli@bootlin.com \
--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=inki.dae@samsung.com \
--cc=jagan@amarulasolutions.com \
--cc=jani.nikula@linux.intel.com \
--cc=jbrunet@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=lumag@kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=mripard@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).