From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org,
"Maxime Ripard" <maxime@cerno.tech>,
"Douglas Anderson" <dianders@chromium.org>,
"Stephen Boyd" <swboyd@chromium.org>,
"Jernej Škrabec" <jernej.skrabec@gmail.com>,
"Rob Clark" <robdclark@chromium.org>,
"Andrzej Hajda" <a.hajda@samsung.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Robert Foss" <robert.foss@linaro.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Sam Ravnborg" <sam@ravnborg.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v3] drm/bridge: sn65dsi86: defer if there is no dsi host
Date: Tue, 7 Dec 2021 13:57:52 -0800 [thread overview]
Message-ID: <20211207215753.635841-1-robdclark@gmail.com> (raw)
From: Rob Clark <robdclark@chromium.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@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.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
WARNING: multiple messages have this Message-ID (diff)
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: "Rob Clark" <robdclark@chromium.org>,
"open list" <linux-kernel@vger.kernel.org>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"David Airlie" <airlied@linux.ie>,
linux-arm-msm@vger.kernel.org, "Jonas Karlman" <jonas@kwiboo.se>,
"Douglas Anderson" <dianders@chromium.org>,
"Jernej Škrabec" <jernej.skrabec@gmail.com>,
"Stephen Boyd" <swboyd@chromium.org>,
"Andrzej Hajda" <a.hajda@samsung.com>,
"Maxime Ripard" <maxime@cerno.tech>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Robert Foss" <robert.foss@linaro.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>
Subject: [PATCH v3] drm/bridge: sn65dsi86: defer if there is no dsi host
Date: Tue, 7 Dec 2021 13:57:52 -0800 [thread overview]
Message-ID: <20211207215753.635841-1-robdclark@gmail.com> (raw)
From: Rob Clark <robdclark@chromium.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@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.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
next reply other threads:[~2021-12-07 21:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 21:57 Rob Clark [this message]
2021-12-07 21:57 ` [PATCH v3] drm/bridge: sn65dsi86: defer if there is no dsi host Rob Clark
2021-12-07 21:59 ` Doug Anderson
2021-12-07 21:59 ` Doug Anderson
2021-12-08 4:43 ` Stephen Boyd
2021-12-08 4:43 ` Stephen Boyd
2021-12-08 16:53 ` Doug Anderson
2021-12-08 16:53 ` Doug Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211207215753.635841-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=narmstrong@baylibre.com \
--cc=robdclark@chromium.org \
--cc=robert.foss@linaro.org \
--cc=sam@ravnborg.org \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.