mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe
@ 2026-01-12 23:47 Marek Vasut
  2026-02-03 22:28 ` Marek Vasut
  2026-02-06  8:18 ` Luca Ceresoli
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2026-01-12 23:47 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, Andrzej Hajda, David Airlie, Jernej Skrabec,
	Jonas Karlman, Laurent Pinchart, Maarten Lankhorst,
	Maxime Ripard, Neil Armstrong, Robert Foss, Simona Vetter,
	Thomas Zimmermann, linux-kernel, linux-renesas-soc

In order to avoid any probe ordering issue, the best practice is to move
the secondary MIPI-DSI device registration and attachment to the
MIPI-DSI host at probe time.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Note that this is similar to e.g. commit
6ef7ee48765f ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe")
and pretty much what every other DSI-to-DPI bridge does.
---
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Robert Foss <rfoss@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
---
 drivers/gpu/drm/bridge/waveshare-dsi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/waveshare-dsi.c b/drivers/gpu/drm/bridge/waveshare-dsi.c
index 43f4e7412d722..9254446f54958 100644
--- a/drivers/gpu/drm/bridge/waveshare-dsi.c
+++ b/drivers/gpu/drm/bridge/waveshare-dsi.c
@@ -80,11 +80,6 @@ static int ws_bridge_bridge_attach(struct drm_bridge *bridge,
 				   enum drm_bridge_attach_flags flags)
 {
 	struct ws_bridge *ws = bridge_to_ws_bridge(bridge);
-	int ret;
-
-	ret = ws_bridge_attach_dsi(ws);
-	if (ret)
-		return ret;
 
 	return drm_bridge_attach(encoder, ws->next_bridge,
 				 &ws->bridge, flags);
@@ -179,7 +174,7 @@ static int ws_bridge_probe(struct i2c_client *i2c)
 	ws->bridge.of_node = dev->of_node;
 	devm_drm_bridge_add(dev, &ws->bridge);
 
-	return 0;
+	return ws_bridge_attach_dsi(ws);
 }
 
 static const struct of_device_id ws_bridge_of_ids[] = {
-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe
  2026-01-12 23:47 [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe Marek Vasut
@ 2026-02-03 22:28 ` Marek Vasut
  2026-02-06  8:18 ` Luca Ceresoli
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2026-02-03 22:28 UTC (permalink / raw)
  To: dri-devel, Joseph Guo
  Cc: Andrzej Hajda, David Airlie, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Maarten Lankhorst, Maxime Ripard,
	Neil Armstrong, Robert Foss, Simona Vetter, Thomas Zimmermann,
	linux-kernel, linux-renesas-soc

On 1/13/26 12:47 AM, Marek Vasut wrote:
> In order to avoid any probe ordering issue, the best practice is to move
> the secondary MIPI-DSI device registration and attachment to the
> MIPI-DSI host at probe time.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Note that this is similar to e.g. commit
> 6ef7ee48765f ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe")
> and pretty much what every other DSI-to-DPI bridge does.
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-renesas-soc@vger.kernel.org
> ---
>   drivers/gpu/drm/bridge/waveshare-dsi.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/waveshare-dsi.c b/drivers/gpu/drm/bridge/waveshare-dsi.c
> index 43f4e7412d722..9254446f54958 100644
> --- a/drivers/gpu/drm/bridge/waveshare-dsi.c
> +++ b/drivers/gpu/drm/bridge/waveshare-dsi.c
> @@ -80,11 +80,6 @@ static int ws_bridge_bridge_attach(struct drm_bridge *bridge,
>   				   enum drm_bridge_attach_flags flags)
>   {
>   	struct ws_bridge *ws = bridge_to_ws_bridge(bridge);
> -	int ret;
> -
> -	ret = ws_bridge_attach_dsi(ws);
> -	if (ret)
> -		return ret;
>   
>   	return drm_bridge_attach(encoder, ws->next_bridge,
>   				 &ws->bridge, flags);
> @@ -179,7 +174,7 @@ static int ws_bridge_probe(struct i2c_client *i2c)
>   	ws->bridge.of_node = dev->of_node;
>   	devm_drm_bridge_add(dev, &ws->bridge);
>   
> -	return 0;
> +	return ws_bridge_attach_dsi(ws);
>   }
>   
>   static const struct of_device_id ws_bridge_of_ids[] = {

Is there anything that should be done with this patch ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe
  2026-01-12 23:47 [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe Marek Vasut
  2026-02-03 22:28 ` Marek Vasut
@ 2026-02-06  8:18 ` Luca Ceresoli
  2026-02-06 12:52   ` Marek Vasut
  1 sibling, 1 reply; 4+ messages in thread
From: Luca Ceresoli @ 2026-02-06  8:18 UTC (permalink / raw)
  To: Marek Vasut, dri-devel
  Cc: Andrzej Hajda, David Airlie, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Maarten Lankhorst, Maxime Ripard,
	Neil Armstrong, Robert Foss, Simona Vetter, Thomas Zimmermann,
	linux-kernel, linux-renesas-soc

Hello Marek,

On Tue Jan 13, 2026 at 12:47 AM CET, Marek Vasut wrote:
> In order to avoid any probe ordering issue, the best practice is to move
> the secondary MIPI-DSI device registration and attachment to the
> MIPI-DSI host at probe time.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Hadn't seen this patch initially, but it caught my attention now.

> Note that this is similar to e.g. commit
> 6ef7ee48765f ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe")
> and pretty much what every other DSI-to-DPI bridge does.

Digression:

  Looking at 6ef7ee48765f, I now realize it has removed one obstacle to the
  DRM bridge hotplug which I'm working to achieve. For the interested,
  there would be one more issue in addition to those I discussed in [0]
  without that commit.

  [0] https://lore.kernel.org/lkml/DE2LCFM56Z2Y.2V9NIXP26QOM2@bootlin.com/

Back to your patch, I don't have the hardware but LGTM and I'm not aware of
any issues it might cause. Still it would be good if you could describe
what goes wrong with current code.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe
  2026-02-06  8:18 ` Luca Ceresoli
@ 2026-02-06 12:52   ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2026-02-06 12:52 UTC (permalink / raw)
  To: Luca Ceresoli, dri-devel
  Cc: Andrzej Hajda, David Airlie, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Maarten Lankhorst, Maxime Ripard,
	Neil Armstrong, Robert Foss, Simona Vetter, Thomas Zimmermann,
	linux-kernel, linux-renesas-soc

On 2/6/26 9:18 AM, Luca Ceresoli wrote:

Hello Luca,

> Back to your patch, I don't have the hardware but LGTM and I'm not aware of
> any issues it might cause. Still it would be good if you could describe
> what goes wrong with current code.
> 
> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

Let me send a V2 with issue description.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-06 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-12 23:47 [PATCH] drm/bridge: waveshare-dsi: Register and attach our DSI device at probe Marek Vasut
2026-02-03 22:28 ` Marek Vasut
2026-02-06  8:18 ` Luca Ceresoli
2026-02-06 12:52   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®