From: sashiko-bot@kernel.org
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v3 5/5] drm: renesas: rz-du: Add support for RZ/T2H SoC
Date: Wed, 13 May 2026 22:48:38 +0000 [thread overview]
Message-ID: <20260513224839.227F3C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260512144104.761531-6-prabhakar.mahadev-lad.rj@bp.renesas.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Register access is performed unconditionally even if hardware clock enablement fails, risking bus errors or system crashes.
--
commit a456e1dcca8021206b701fc39c90471891f25115
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
drm: renesas: rz-du: Add support for RZ/T2H SoC
This commit adds support for the RZ/T2H (R9A09G077) SoC, which includes a
DU with a DPI interface. It requires an explicit assertion of a DPI
output-enable signal during CRTC startup.
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> index 2b772a11c7eec..017d5f26bc965 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
[ ... ]
> @@ -217,8 +218,12 @@ static void rzg2l_du_crtc_put(struct rzg2l_du_crtc *rcrtc)
> static void rzg2l_du_start_stop(struct rzg2l_du_crtc *rcrtc, bool start)
> {
> struct rzg2l_du_device *rcdu = rcrtc->dev;
> + u32 val = DU_MCR0_DI_EN;
>
> - writel(start ? DU_MCR0_DI_EN : 0, rcdu->mmio + DU_MCR0);
> + if (start && rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_DPIO_OE))
> + val |= DU_MCR0_DPI_EN;
> +
> + writel(start ? val : 0, rcdu->mmio + DU_MCR0);
> }
>
> static void rzg2l_du_crtc_start(struct rzg2l_du_crtc *rcrtc)
This isn't a bug introduced by this patch, but this modifies the register
write logic inside an unsafe hardware path.
In rzg2l_du_crtc_atomic_enable(), rzg2l_du_crtc_get(rcrtc) is called to enable
clocks and deassert the reset controller, but its return value is ignored:
drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c:rzg2l_du_crtc_atomic_enable() {
...
rzg2l_du_crtc_get(rcrtc);
rzg2l_du_crtc_start(rcrtc);
}
If clock enablement fails, the driver unconditionally proceeds to
rzg2l_du_crtc_start(), which accesses the DU_MCR0 MMIO register via
rzg2l_du_start_stop() above.
Could accessing MMIO registers without the corresponding clocks enabled result
in an external asynchronous abort or bus lockup, leading to a system crash?
Although atomic_enable cannot return an error to the DRM core, should it at
least skip subsequent hardware register accesses to avoid crashing the system
if rzg2l_du_crtc_get() fails?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260512144104.761531-1-prabhakar.mahadev-lad.rj@bp.renesas.com?part=5
prev parent reply other threads:[~2026-05-13 22:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 14:40 [PATCH v3 0/5] Add DU support for RZ/T2H and RZ/N2H SoCs Prabhakar
2026-05-12 14:41 ` [PATCH v3 1/5] dt-bindings: display: renesas,rzg2l-du: Refuse port@1 for RZ/G2UL Prabhakar
2026-05-12 14:41 ` [PATCH v3 2/5] dt-bindings: display: renesas,rzg2l-du: Add RZ/T2H and RZ/N2H support Prabhakar
2026-05-12 14:41 ` [PATCH v3 3/5] drm: renesas: rz-du: Make DU reset control optional for RZ/T2H support Prabhakar
2026-05-12 14:41 ` [PATCH v3 4/5] drm: renesas: rz-du: Move mode_valid logic to per-output clock limits Prabhakar
2026-05-13 23:02 ` Laurent Pinchart
2026-05-12 14:41 ` [PATCH v3 5/5] drm: renesas: rz-du: Add support for RZ/T2H SoC Prabhakar
2026-05-13 22:48 ` 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=20260513224839.227F3C19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=prabhakar.csengg@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.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