From: sashiko-bot@kernel.org
To: "Archit More" <architmore303@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi() functions
Date: Tue, 10 Nov 2026 08:35:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-206634@kernel.org> (raw)
In-Reply-To: <20261110082535.7998-1-architmore303@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/panel: state imbalance in kingdisplay_panel_unprepare()
on DSI error
- [Medium] drm/panel: kingdisplay_panel_disable() error return leaves
panel enabled
--
commit ce1c20733cce84cf65434f3ef6732b56a7367cda
Author: Archit More <architmore303@gmail.com>
drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi() functions
This commit converts the Kingdisplay KD097D04 panel driver's disable,
unprepare, and prepare callbacks to use the mipi_dsi_*_multi() helpers.
> diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> index 893af9b167567..01f5a96f1cfbf 100644
> --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> @@ -180,28 +180,21 @@ struct kingdisplay_panel *to_kingdisplay_panel(struct drm_panel *panel)
> static int kingdisplay_panel_disable(struct drm_panel *panel)
> {
> struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
> - int err;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = kingdisplay->link };
>
> - err = mipi_dsi_dcs_set_display_off(kingdisplay->link);
> - if (err < 0)
> - dev_err(panel->dev, "failed to set display off: %d\n", err);
> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
[Severity: Medium]
Should kingdisplay_panel_disable() still return 0 here?
In drm_panel_disable(), the backlight is disabled before calling
panel->funcs->disable(), and a negative return value skips clearing
panel->enabled. If mipi_dsi_dcs_set_display_off_multi() fails,
panel->enabled remains true and the next drm_panel_enable() returns early
without re-enabling the backlight.
> static int kingdisplay_panel_unprepare(struct drm_panel *panel)
> {
> struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = kingdisplay->link };
> int err;
>
> - err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link);
> - if (err < 0) {
> - dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
> - return err;
> - }
> -
> - /* T15: 120ms */
> - msleep(120);
> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0);
>
> @@ -209,12 +202,13 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel)
> if (err < 0)
> return err;
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
[Severity: Medium]
Does returning dsi_ctx.accum_err after disabling kingdisplay->supply leave
panel->prepared out of sync with the hardware state?
When mipi_dsi_dcs_enter_sleep_mode_multi() fails, this function still
deasserts enable_gpio and disables kingdisplay->supply, but returns a
negative error code to drm_panel_unprepare(), which then skips setting
panel->prepared = false. The next drm_panel_prepare() sees panel->prepared
as true and skips powering the panel back on, while a subsequent
drm_panel_unprepare() calls regulator_disable() a second time and
underflows the regulator enable count.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110082535.7998-1-architmore303@gmail.com?part=1
prev parent reply other threads:[~2026-11-10 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 8:25 [PATCH] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi() functions Archit More
2026-11-10 8:35 ` sashiko-bot [this message]
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=sashiko-outbox-206634@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=architmore303@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.