From: Hsieh Hung-En <hungen3108@gmail.com>
To: dianders@chromium.org, neil.armstrong@linaro.org, jesszhan0024@gmail.com
Cc: jagan@amarulasolutions.com, osama.abdelkader@gmail.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
Hsieh Hung-En <hungen3108@gmail.com>
Subject: [PATCH v2 1/5] drm/panel: feiyang-fy07024di26a30d: Fix prepare error cleanup
Date: Mon, 2 Nov 2026 12:32:11 +0800 [thread overview]
Message-ID: <20261102043215.990351-2-hungen3108@gmail.com> (raw)
In-Reply-To: <20261102043215.990351-1-hungen3108@gmail.com>
feiyang_prepare() returns without disabling previously enabled
regulators if enabling AVDD or writing DCS commands fails. Since
drm_panel_prepare() does not mark the panel as prepared on failure,
drm_panel_unprepare() does not call the driver's unprepare() callback,
leaving regulator enable counts elevated even after subsequent
successful prepare/unprepare cycles.
Disable DVDD if enabling AVDD fails. On a DCS write failure, restore
the reset GPIO to its unprepared state and disable both regulators,
preserving the existing 10 ms power-off interval between AVDD and DVDD.
Fixes: 69dc678abc2b ("drm/panel: Add Feiyang FY07024DI26A30-D MIPI-DSI LCD panel")
Reported-by: Douglas Anderson <dianders@chromium.org>
Closes: https://lore.kernel.org/r/CAD=FV=Xm48DUT==8HuuGCSFZtLTEk-W2Q6UTfqt-MnM4nULzTw@mail.gmail.com
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
---
Notes:
Power sequencing note:
The error path retains the 10 ms AVDD-to-DVDD shutdown interval
used by unprepare().
The FY07024DI26A30-D datasheet, Section 7.3 (Power, Signal sequence),
specifies T10 > 0 between AVDD/VGL reaching GND and DVDD starting
to fall. The delay allows time for AVDD to discharge before disabling
DVDD, but compliance with T10 has not been verified on hardware.
The existing unprepare() comment associates the delay with T11,
which actually specifies the DVDD fall time (0 < T11 <= 10 ms).
That comment can be corrected separately.
The msleep(10) checkpatch warning is expected. T10 has no specified
upper bound, so a longer sleep does not violate that timing constraint.
msleep() is retained to match the existing unprepare() sequence.
Datasheet:
https://files.pine64.org/doc/datasheet/pine64/FY07024DI26A30-D_feiyang_LCD_panel.pdf
.../gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
index c1d8ca5ca6e1..bb4cc1ea2ece 100644
--- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
+++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
@@ -59,7 +59,7 @@ static int feiyang_prepare(struct drm_panel *panel)
ret = regulator_enable(ctx->avdd);
if (ret)
- return ret;
+ goto disable_dvdd;
/* T3 (dvdd rise + avdd start + avdd rise) T3 >= 20ms */
msleep(20);
@@ -84,10 +84,21 @@ static int feiyang_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write_buffer(dsi, cmd->data,
FEIYANG_INIT_CMD_LEN);
if (ret < 0)
- return ret;
+ goto assert_reset;
}
return 0;
+
+assert_reset:
+ gpiod_set_value(ctx->reset, 0);
+ regulator_disable(ctx->avdd);
+
+ /* Preserve the AVDD-to-DVDD shutdown delay from unprepare(). */
+ msleep(10);
+
+disable_dvdd:
+ regulator_disable(ctx->dvdd);
+ return ret;
}
static int feiyang_enable(struct drm_panel *panel)
--
2.43.0
next prev parent reply other threads:[~2026-11-02 4:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 4:32 [PATCH v2 0/5] drm/panel: Use mipi_dsi_*_multi() in feiyang and rm68200 Hsieh Hung-En
2026-11-02 4:32 ` Hsieh Hung-En [this message]
2026-11-02 13:00 ` [PATCH v2 1/5] drm/panel: feiyang-fy07024di26a30d: Fix prepare error cleanup neil.armstrong
2026-11-02 4:32 ` [PATCH v2 2/5] drm/panel: raydium-rm68200: " Hsieh Hung-En
2026-11-02 13:01 ` neil.armstrong
2026-11-02 4:32 ` [PATCH v2 3/5] drm/panel: feiyang-fy07024di26a30d: Use mipi_dsi_*_multi() functions Hsieh Hung-En
2026-11-02 13:02 ` neil.armstrong
2026-11-02 4:32 ` [PATCH v2 4/5] drm/panel: raydium-rm68200: " Hsieh Hung-En
2026-11-02 13:02 ` neil.armstrong
2026-11-02 4:32 ` [PATCH v2 5/5] drm/panel: raydium-rm68200: Use lowercase hex literals Hsieh Hung-En
2026-11-02 13:02 ` neil.armstrong
2026-11-02 13:40 ` [PATCH v2 0/5] drm/panel: Use mipi_dsi_*_multi() in feiyang and rm68200 Neil Armstrong
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=20261102043215.990351-2-hungen3108@gmail.com \
--to=hungen3108@gmail.com \
--cc=airlied@gmail.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagan@amarulasolutions.com \
--cc=jesszhan0024@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=osama.abdelkader@gmail.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®