From: Svyatoslav Ryhel <clamor95@gmail.com>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Thierry Reding <treding@nvidia.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Mikko Perttunen <mperttunen@nvidia.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Svyatoslav Ryhel <clamor95@gmail.com>,
Dmitry Osipenko <digetx@gmail.com>,
Charan Pedumuru <charan.pedumuru@gmail.com>
Cc: devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH v2 2/4 RESEND] gpu/drm: tegra: dsi: move prepare function to the top of encoder enable
Date: Thu, 4 Dec 2025 08:17:01 +0200 [thread overview]
Message-ID: <20251204061703.5579-3-clamor95@gmail.com> (raw)
In-Reply-To: <20251204061703.5579-1-clamor95@gmail.com>
The tegra_dsi_prepare function performs hardware setup and should be
called before any register readings or there will be a risk of device
hangup on register access. To avoid this situation, tegra_dsi_prepare must
be called at the beginning of tegra_dsi_encoder_enable.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/gpu/drm/tegra/dsi.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 278bf2c85524..8e80c7efe8b4 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -914,6 +914,12 @@ static void tegra_dsi_encoder_enable(struct drm_encoder *encoder)
u32 value;
int err;
+ err = tegra_dsi_prepare(dsi);
+ if (err < 0) {
+ dev_err(dsi->dev, "failed to prepare: %d\n", err);
+ return;
+ }
+
/* If the bootloader enabled DSI it needs to be disabled
* in order for the panel initialization commands to be
* properly sent.
@@ -923,12 +929,6 @@ static void tegra_dsi_encoder_enable(struct drm_encoder *encoder)
if (value & DSI_POWER_CONTROL_ENABLE)
tegra_dsi_disable(dsi);
- err = tegra_dsi_prepare(dsi);
- if (err < 0) {
- dev_err(dsi->dev, "failed to prepare: %d\n", err);
- return;
- }
-
state = tegra_dsi_get_state(dsi);
tegra_dsi_set_timeout(dsi, state->bclk, state->vrefresh);
--
2.48.1
next prev parent reply other threads:[~2025-12-04 6:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-04 6:16 [PATCH v2 0/4 RESEND] gpu/drm: tegra: add DSI support for Tegra20/Tegra30 Svyatoslav Ryhel
2025-12-04 6:17 ` [PATCH v2 1/4 RESEND] clk: tegra20: reparent dsi clock to pll_d_out0 Svyatoslav Ryhel
2026-01-15 7:08 ` Mikko Perttunen
2026-01-17 0:19 ` Thierry Reding
2025-12-04 6:17 ` Svyatoslav Ryhel [this message]
2026-01-15 5:47 ` [PATCH v2 2/4 RESEND] gpu/drm: tegra: dsi: move prepare function to the top of encoder enable Mikko Perttunen
2026-01-15 7:49 ` Svyatoslav Ryhel
2026-01-24 20:19 ` Svyatoslav Ryhel
2025-12-04 6:17 ` [PATCH v2 3/4 RESEND] gpu/drm: tegra: dsi: add support for Tegra20/Tegra30 Svyatoslav Ryhel
2026-01-15 7:02 ` Mikko Perttunen
2026-01-15 7:45 ` Svyatoslav Ryhel
2025-12-04 6:17 ` [PATCH v2 4/4 RESEND] ARM: tegra: adjust DSI nodes " Svyatoslav Ryhel
2026-01-15 7:06 ` Mikko Perttunen
2026-01-17 0:19 ` Thierry Reding
2026-01-17 0:25 ` (subset) [PATCH v2 0/4 RESEND] gpu/drm: tegra: add DSI support " Thierry Reding
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=20251204061703.5579-3-clamor95@gmail.com \
--to=clamor95@gmail.com \
--cc=airlied@gmail.com \
--cc=charan.pedumuru@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=mturquette@baylibre.com \
--cc=pgaikwad@nvidia.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=simona@ffwll.ch \
--cc=thierry.reding@gmail.com \
--cc=treding@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox