Skip to content

Commit c73588c

Browse files
committed
drm/msm/dsi: move next bridge acquisition to dsi_bind
Currently the MSM DSI driver looks for the next bridge during msm_dsi_modeset_init(). If the bridge is not registered at that point, this might result in -EPROBE_DEFER, which can be problematic that late during the device probe process. Move next bridge acquisition to the dsi_bind state so that probe deferral is returned as early as possible. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/582210/ Link: https://lore.kernel.org/r/[email protected]
1 parent 9febe4a commit c73588c

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

drivers/gpu/drm/msm/dsi/dsi.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
120120
struct msm_drm_private *priv = dev_get_drvdata(master);
121121
struct msm_dsi *msm_dsi = dev_get_drvdata(dev);
122122

123+
/*
124+
* Next bridge doesn't exist for the secondary DSI host in a bonded
125+
* pair.
126+
*/
127+
if (!msm_dsi_is_bonded_dsi(msm_dsi) ||
128+
msm_dsi_is_master_dsi(msm_dsi)) {
129+
struct drm_bridge *ext_bridge;
130+
131+
ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
132+
msm_dsi->pdev->dev.of_node, 1, 0);
133+
if (IS_ERR(ext_bridge))
134+
return PTR_ERR(ext_bridge);
135+
136+
msm_dsi->next_bridge = ext_bridge;
137+
}
138+
123139
priv->dsi[msm_dsi->id] = msm_dsi;
124140

125141
return 0;

drivers/gpu/drm/msm/dsi/dsi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ struct msm_dsi {
3838
struct mipi_dsi_host *host;
3939
struct msm_dsi_phy *phy;
4040

41+
struct drm_bridge *next_bridge;
42+
4143
struct device *phy_dev;
4244
bool phy_enabled;
4345

drivers/gpu/drm/msm/dsi/dsi_manager.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,12 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
464464
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
465465
struct drm_device *dev = msm_dsi->dev;
466466
struct drm_encoder *encoder;
467-
struct drm_bridge *ext_bridge;
468467
struct drm_connector *connector;
469468
int ret;
470469

471-
ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
472-
msm_dsi->pdev->dev.of_node, 1, 0);
473-
if (IS_ERR(ext_bridge))
474-
return PTR_ERR(ext_bridge);
475-
476470
encoder = int_bridge->encoder;
477471

478-
ret = drm_bridge_attach(encoder, ext_bridge, int_bridge,
472+
ret = drm_bridge_attach(encoder, msm_dsi->next_bridge, int_bridge,
479473
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
480474
if (ret)
481475
return ret;

0 commit comments

Comments
 (0)