Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, robh@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v4 2/5] drm/panel: add Novatek NT36850 panel driver
Date: Thu, 15 Oct 2026 08:58:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-172528@kernel.org> (raw)
In-Reply-To: <20261015-sdm845-hdk-v4-2-b532b9f4029c@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] drm/panel: nt36850: variable shadowing in nt36850_disable() masks DCS errors
- [Medium] drm/panel: nt36850: unconditional dereference of dsi1 in nt36850_disable() breaks single-DSI
--

commit 08efb97fa82649f7024ae6605a2b0d90177ccd63
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

drm/panel: add Novatek NT36850 panel driver
    
Add support for the Truly WQHD dual-DSI command mode panel built around
the Novatek NT36850, found on the display card for the Qualcomm SDM845
and SM8150 HDK.

> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36850.c b/drivers/gpu/drm/panel/panel-novatek-nt36850.c
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36850.c
> @@ -0,0 +1,351 @@
> [ ... ]
> +static int nt36850_disable(struct drm_panel *panel)
> +{
> +	struct panel_info *pinfo = to_panel_info(panel);
> +	struct mipi_dsi_device *dsi0 = pinfo->dsi[0];
> +	struct mipi_dsi_device *dsi1 = pinfo->dsi[1];
> +	struct mipi_dsi_multi_context dsi_ctx = { .dsi = NULL };
> +
> +	dsi0->mode_flags &= ~MIPI_DSI_MODE_LPM;
> +	dsi1->mode_flags &= ~MIPI_DSI_MODE_LPM;

[Severity: Medium]
Does this code introduce a regression by unconditionally dereferencing
a NULL pointer if a single-DSI panel is supported in the future?

The dynamic nt36850_num_dsi_hosts check later in this function implies
it is intended to support single-DSI setups, but dsi1 is used directly
here without verification.

> +
> +	for (int i = 0; i < nt36850_num_dsi_hosts(pinfo); i++) {
> +		struct mipi_dsi_multi_context dsi_ctx = { .dsi = pinfo->dsi[i]};
> +
> +		mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
> +	}

[Severity: Medium]
Is it a regression that the inner dsi_ctx shadows the function-scoped
dsi_ctx?

By declaring a new dsi_ctx inside the loop, the error state from
mipi_dsi_dcs_set_display_off_multi gets instantly discarded when the
block ends, rather than accumulating.

> +	mipi_dsi_msleep(&dsi_ctx, 120);

[Severity: Medium]
Because the inner dsi_ctx shadowed the outer one, does this blindly
execute the delay using the unmodified outer context, even if the display
off sequence commands failed?

> +
> +	for (int i = 0; i < nt36850_num_dsi_hosts(pinfo); i++) {
> +		struct mipi_dsi_multi_context dsi_ctx = { .dsi = pinfo->dsi[i]};
> +
> +		mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
> +	}
> +	mipi_dsi_msleep(&dsi_ctx, 120);
> +
> +	dsi0->mode_flags |= MIPI_DSI_MODE_LPM;
> +	dsi1->mode_flags |= MIPI_DSI_MODE_LPM;

[Severity: Medium]
Could this result in another NULL pointer dereference regression for
single-DSI panels here when restoring the mode flags?

> +
> +	return dsi_ctx.accum_err;
> +}

[Severity: Medium]
Since the function-level dsi_ctx remains unmodified throughout, will
this always return 0 and mask any hardware failures that occurred during
the disable sequence?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-sdm845-hdk-v4-0-b532b9f4029c@oss.qualcomm.com?part=2

  reply	other threads:[~2026-10-15  8:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  8:39 [PATCH v4 0/5] arm64: dts: qcom: support SDM845 HDK Dmitry Baryshkov
2026-10-15  8:39 ` [PATCH v4 1/5] dt-bindings: display: panel: add Truly NT36850 WQHD panel Dmitry Baryshkov
2026-10-15  8:39 ` [PATCH v4 2/5] drm/panel: add Novatek NT36850 panel driver Dmitry Baryshkov
2026-10-15  8:58   ` sashiko-bot [this message]
2026-10-15  8:39 ` [PATCH v4 3/5] dt-bindings: arm: qcom: add Qualcomm SDM845 HDK Dmitry Baryshkov
2026-10-15  8:39 ` [PATCH v4 4/5] arm64: dts: qcom: add device tree for SDM845-HDK Dmitry Baryshkov
2026-10-15  8:51   ` sashiko-bot
2026-10-15  9:05   ` Konrad Dybcio
2026-10-15  8:39 ` [PATCH v4 5/5] arm64: dts: qcom: sdm845-hdk: add display card overlay Dmitry Baryshkov

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-172528@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox