[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250820152407.2788495-2-john.ripple@keysight.com>
Date: Wed, 20 Aug 2025 09:24:07 -0600
From: John Ripple <john.ripple@...sight.com>
To: dianders@...omium.org, andrzej.hajda@...el.com, neil.armstrong@...aro.org,
rfoss@...nel.org, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com,
simona@...ll.ch
Cc: Laurent.pinchart@...asonboard.com, jonas@...boo.se,
jernej.skrabec@...il.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, John Ripple <john.ripple@...sight.com>
Subject: [PATCH 2/2] drm/bridge: ti-sn65dsi86: break probe dependency loop
The commit c3b75d4734cb ("drm/bridge: sn65dsi86: Register and attach our
DSI device at probe") was intended to prevent probe ordering issues and
created the ti_sn_attach_host function.
In practice, I found the following when using the nwl-dsi driver:
- ti_sn_bridge_probe happens and it adds the i2c bridge. Then
ti_sn_attach_host runs (in the ti_sn_bridge_probe function) and fails to
find the dsi host which then returns to ti_sn_bridge_probe and removes
the i2c bridge because of the failure.
- The nwl_dsi_probe then runs and adds dsi host to the host list and then
looks for the i2c bridge, which is now gone, so it fails. This loop
continues for the entire boot sequence.
Looking at the other drivers (like simple-bridge.c) they end the probe
function after attaching the bridge with no option to remove the bridge in
the probe. Moving the ti_sn_attach_host to the ti_sn_bridge_attach function
follows the format of other drivers and ensures the i2c bridge won't be
removed while probing is still occurring fixing the dependency loop.
Signed-off-by: John Ripple <john.ripple@...sight.com>
---
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 75f9be347b41..58dfb0f39cea 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -815,6 +815,7 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge,
{
struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge);
int ret;
+ struct auxiliary_device *adev = pdata->bridge_aux;
pdata->aux.drm_dev = bridge->dev;
ret = drm_dp_aux_register(&pdata->aux);
@@ -823,6 +824,12 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge,
return ret;
}
+ ret = ti_sn_attach_host(adev, pdata);
+ if (ret) {
+ dev_err_probe(&adev->dev, ret, "failed to attach dsi host\n");
+ goto err_remove_bridge;
+ }
+
/*
* Attach the next bridge.
* We never want the next bridge to *also* create a connector.
@@ -849,6 +856,9 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge,
err_initted_aux:
drm_dp_aux_unregister(&pdata->aux);
return ret;
+err_remove_bridge:
+ drm_bridge_remove(&pdata->bridge);
+ return ret;
}
static void ti_sn_bridge_detach(struct drm_bridge *bridge)
@@ -1574,17 +1584,7 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
drm_bridge_add(&pdata->bridge);
- ret = ti_sn_attach_host(adev, pdata);
- if (ret) {
- dev_err_probe(&adev->dev, ret, "failed to attach dsi host\n");
- goto err_remove_bridge;
- }
-
return 0;
-
-err_remove_bridge:
- drm_bridge_remove(&pdata->bridge);
- return ret;
}
static void ti_sn_bridge_remove(struct auxiliary_device *adev)
Powered by blists - more mailing lists