[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211207215753.635841-1-robdclark@gmail.com>
Date: Tue, 7 Dec 2021 13:57:52 -0800
From: Rob Clark <robdclark@...il.com>
To: dri-devel@...ts.freedesktop.org
Cc: linux-arm-msm@...r.kernel.org, Maxime Ripard <maxime@...no.tech>,
Douglas Anderson <dianders@...omium.org>,
Stephen Boyd <swboyd@...omium.org>,
Jernej Škrabec <jernej.skrabec@...il.com>,
Rob Clark <robdclark@...omium.org>,
Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Robert Foss <robert.foss@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Sam Ravnborg <sam@...nborg.org>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v3] drm/bridge: sn65dsi86: defer if there is no dsi host
From: Rob Clark <robdclark@...omium.org>
Otherwise we don't get another shot at it if the bridge probes before
the dsi host is registered. It seems like this is what *most* (but not
all) of the other bridges do.
It looks like this was missed in the conversion to attach dsi host at
probe time.
Fixes: c3b75d4734cb ("drm/bridge: sn65dsi86: Register and attach our DSI device at probe")
Signed-off-by: Rob Clark <robdclark@...omium.org>
Reviewed-by: Doug Anderson <dianders@...omium.org>
---
v2: Drop DRM_ERROR() in favor of drm_err_probe() and shift around the
spot where we report the error
v3: Add \n and cull error msgs a bit further
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 02b490671f8f..c2928a6409b1 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -714,16 +714,12 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
};
host = of_find_mipi_dsi_host_by_node(pdata->host_node);
- if (!host) {
- DRM_ERROR("failed to find dsi host\n");
- return -ENODEV;
- }
+ if (!host)
+ return -EPROBE_DEFER;
dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
- if (IS_ERR(dsi)) {
- DRM_ERROR("failed to create dsi device\n");
+ if (IS_ERR(dsi))
return PTR_ERR(dsi);
- }
/* TODO: setting to 4 MIPI lanes always for now */
dsi->lanes = 4;
@@ -740,10 +736,8 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
pdata->dsi = dsi;
ret = devm_mipi_dsi_attach(dev, dsi);
- if (ret < 0) {
- DRM_ERROR("failed to attach dsi to host\n");
+ if (ret < 0)
return ret;
- }
return 0;
}
@@ -1267,8 +1261,10 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
drm_bridge_add(&pdata->bridge);
ret = ti_sn_attach_host(pdata);
- if (ret)
+ if (ret) {
+ dev_err_probe(pdata->dev, ret, "failed to attach dsi host\n");
goto err_remove_bridge;
+ }
return 0;
--
2.33.1
Powered by blists - more mailing lists