All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: amit <amittibi123@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/panel: Replace deprecated DCS display-on calls
Date: Wed, 04 Nov 2026 07:47:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-196821@kernel.org> (raw)
In-Reply-To: <20261104073813.42429-1-amittibi123@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/panel: uninitialized return value in k101_im2ba02_enable() on DSI error
- [Low] drm/panel: single-call mipi_dsi_multi_context misuse and duplicate dev_err()
--

commit 98ea9fe2e57e340101561581a07219ed561f36d0
Author: amit <amittibi123@gmail.com>

drm/panel: Replace deprecated DCS display-on calls

This commit replaces calls to mipi_dsi_dcs_set_display_on() across 14 DRM
panel drivers with mipi_dsi_dcs_set_display_on_multi() using a local
mipi_dsi_multi_context structure.

> diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> index 4a8560b4b899a..a4b35e042f315 100644
> --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> @@ -155,7 +155,12 @@ static int boe_panel_prepare(struct drm_panel *panel)
>  	/* T6: 120ms - 121ms */
>  	usleep_range(120000, 121000);
>  
> -	err = mipi_dsi_dcs_set_display_on(pinfo->link);
> +	struct mipi_dsi_multi_context dsi_ctx = {
> +		.dsi = pinfo->link,
> +	};
> +
> +	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
> +	err = dsi_ctx.accum_err;
>  	if (err < 0) {
>  		dev_err(panel->dev, "failed to set display on: %d\n", err);
>  		goto poweroff;

[Severity: Low]
This isn't a bug, but is it intended to instantiate struct
mipi_dsi_multi_context mid-function for just a single
mipi_dsi_dcs_set_display_on_multi() call while leaving the surrounding DSI
calls (such as mipi_dsi_dcs_exit_sleep_mode(), mipi_dsi_dcs_set_tear_on(),
mipi_dsi_dcs_set_pixel_format(), and mipi_dsi_dcs_write_buffer()) unconverted?

In addition, mipi_dsi_dcs_set_display_on_multi() in
drivers/gpu/drm/drm_mipi_dsi.c already logs an error on failure:

	ret = mipi_dsi_dcs_set_display_on(dsi);
	if (ret < 0) {
		ctx->accum_err = ret;
		dev_err(dev, "sending DCS SET_DISPLAY_ON failed: %d\n",
			ctx->accum_err);
	}

Keeping the caller's dev_err() here in boe_panel_prepare() (as well as in
boe_panel_enable(), innolux_panel_prepare(), khadas_ts050_panel_prepare(),
kingdisplay_panel_prepare(), ltk500hd1829_prepare(), panel_nv3051d_prepare(),
nt35510_prepare(), rad_panel_enable(), and sharp_panel_prepare()) will print
duplicate error messages when setting the display on fails. Declaring
dsi_ctx in the middle of the function after executable statements also
introduces mixed declarations across 12 of the modified drivers (including
dsicm_power_on(), rm68200_prepare(), and s6e63j0x03_enable()).

Should the full DSI command sequences in these functions be converted to use
a single mipi_dsi_multi_context declared at the top of each function with the
redundant dev_err() calls removed?

[ ... ]

> diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> index 8c3a231c147d5..baa64b7aeb0bd 100644
> --- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> +++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> @@ -344,12 +344,15 @@ static int k101_im2ba02_enable(struct drm_panel *panel)
>  {
>  	struct k101_im2ba02 *ctx = panel_to_k101_im2ba02(panel);
>  	const struct k101_im2ba02_init_cmd *cmd = &timed_cmds[1];
> +	struct mipi_dsi_multi_context dsi_ctx = {
> +		.dsi = ctx->dsi,
> +	};
>  	int ret;
>  
>  	msleep(150);
>  
> -	ret = mipi_dsi_dcs_set_display_on(ctx->dsi);
> -	if (ret < 0)
> +	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
> +	if (dsi_ctx.accum_err)
>  		return ret;

[Severity: High]
In k101_im2ba02_enable(), doesn't this return the uninitialized local
variable ret when mipi_dsi_dcs_set_display_on_multi() fails and sets
dsi_ctx.accum_err?

Since ret is never initialized or assigned, returning ret on error triggers
an uninitialized variable warning and can return a non-negative garbage value
to drm_panel_enable(), causing it to treat a failed panel enable as
successful while skipping the final mipi_dsi_dcs_write_buffer() command.

Should ret be removed and dsi_ctx.accum_err returned directly instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104073813.42429-1-amittibi123@gmail.com?part=1

  reply	other threads:[~2026-11-04  7:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  7:38 [PATCH] drm/panel: Replace deprecated DCS display-on calls amit
2026-11-04  7:47 ` sashiko-bot [this message]
2026-11-04 12:11 ` Linus Walleij
2026-11-07 21:44 ` kernel test robot
2026-11-08 13:39   ` amit tibi

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-196821@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amittibi123@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.