Skip to content

Commit d4ca26a

Browse files
committed
drm/msm/dp: call dp_display_get_next_bridge() during probe
The funcion dp_display_get_next_bridge() can return -EPROBE_DEFER if the next bridge is not (yet) available. However returning -EPROBE_DEFER from msm_dp_modeset_init() is not ideal. This leads to -EPROBE return from component_bind, which can easily result in -EPROBE_DEFR loops. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> # sc8180x-primus Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/566208/ Link: https://lore.kernel.org/r/20231107004424.2112698-1-dmitry.baryshkov@linaro.org
1 parent 3313c23 commit d4ca26a

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,15 +1210,27 @@ static const struct msm_dp_desc *dp_display_get_desc(struct platform_device *pde
12101210
return NULL;
12111211
}
12121212

1213-
static int dp_auxbus_done_probe(struct drm_dp_aux *aux)
1213+
static int dp_display_get_next_bridge(struct msm_dp *dp);
1214+
1215+
static int dp_display_probe_tail(struct device *dev)
12141216
{
1215-
int rc;
1217+
struct msm_dp *dp = dev_get_drvdata(dev);
1218+
int ret;
12161219

1217-
rc = component_add(aux->dev, &dp_display_comp_ops);
1218-
if (rc)
1219-
DRM_ERROR("eDP component add failed, rc=%d\n", rc);
1220+
ret = dp_display_get_next_bridge(dp);
1221+
if (ret)
1222+
return ret;
12201223

1221-
return rc;
1224+
ret = component_add(dev, &dp_display_comp_ops);
1225+
if (ret)
1226+
DRM_ERROR("component add failed, rc=%d\n", ret);
1227+
1228+
return ret;
1229+
}
1230+
1231+
static int dp_auxbus_done_probe(struct drm_dp_aux *aux)
1232+
{
1233+
return dp_display_probe_tail(aux->dev);
12221234
}
12231235

12241236
static int dp_display_probe(struct platform_device *pdev)
@@ -1293,11 +1305,9 @@ static int dp_display_probe(struct platform_device *pdev)
12931305
goto err;
12941306
}
12951307
} else {
1296-
rc = component_add(&pdev->dev, &dp_display_comp_ops);
1297-
if (rc) {
1298-
DRM_ERROR("component add failed, rc=%d\n", rc);
1308+
rc = dp_display_probe_tail(&pdev->dev);
1309+
if (rc)
12991310
goto err;
1300-
}
13011311
}
13021312

13031313
return rc;
@@ -1428,7 +1438,7 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
14281438
* For DisplayPort interfaces external bridges are optional, so
14291439
* silently ignore an error if one is not present (-ENODEV).
14301440
*/
1431-
rc = devm_dp_parser_find_next_bridge(dp->drm_dev->dev, dp_priv->parser);
1441+
rc = devm_dp_parser_find_next_bridge(&dp->pdev->dev, dp_priv->parser);
14321442
if (!dp->is_edp && rc == -ENODEV)
14331443
return 0;
14341444

@@ -1448,10 +1458,6 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
14481458

14491459
dp_priv = container_of(dp_display, struct dp_display_private, dp_display);
14501460

1451-
ret = dp_display_get_next_bridge(dp_display);
1452-
if (ret)
1453-
return ret;
1454-
14551461
ret = dp_bridge_init(dp_display, dev, encoder);
14561462
if (ret) {
14571463
DRM_DEV_ERROR(dev->dev,

0 commit comments

Comments
 (0)