Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ze Huang" <ze.huang@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, Frank.Li@kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH 8/9] drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
Date: Sat, 04 Jul 2026 18:46:14 +0000	[thread overview]
Message-ID: <20260704184615.466FA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260705-drm-simple-kms-removal-v1-8-b4e1ca053623@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:

New issues:
- [High] Vblank event is leaked on CRTC disable and may be delivered prematurely on CRTC enable.
- [Medium] Calling `drm_connector_attach_encoder()` on an uninitialized connector.

Pre-existing issues:
- [High] Calling `usleep_range()` from a CRTC `atomic_enable` callback.
- [High] Direct, lockless access to global state pointers `plane->state` and `crtc->state` in atomic commit callbacks.
--

Note: The format of this review has been altered to a free-form summary due
to mailing list quoting restrictions.

Commit: 2c5e6508a64461d7a207075c4328681142076aef
Author: Ze Huang <ze.huang@oss.qualcomm.com>
Subject: drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
Summary: This commit converts the TVE200 driver to use explicit plane, CRTC,
and encoder objects instead of the simple display pipe helpers, while keeping
generic plane-state validation and GEM framebuffer preparation.

[Severity: High]
In drivers/gpu/drm/tve200/tve200_display.c,
tve200_plane_helper_atomic_update() checks if the CRTC is NULL and returns
early. Does this cause the pending vblank event to be leaked during a CRTC
disable, since the plane is also disabled (making crtc NULL) and the event
is never consumed?

Additionally, since commit_planes() executes before commit_modeset_enables(),
is the event processed and delivered prematurely on CRTC enable? Could the
event consumption be moved to CRTC callbacks like atomic_enable,
atomic_disable, or atomic_flush instead of handling it in the plane callback?

[Severity: Medium]
In drivers/gpu/drm/tve200/tve200_drv.c, tve200_modeset_init() gets the
connector using drm_panel_bridge_connector() and immediately passes it to
drm_connector_attach_encoder(). Since drm_bridge_attach() has not run yet,
is this modifying an uninitialized DRM object structure?

Would it be better to rely on panel_bridge_attach(), which already
automatically handles attaching the connector to the encoder, making this
manual call redundant?

[Severity: High]
This isn't a bug introduced by this patch, but in
drivers/gpu/drm/tve200/tve200_display.c, tve200_crtc_helper_atomic_enable()
contains a hardware polling loop that calls usleep_range(30000, 50000).
Since CRTC atomic enable callbacks run in atomic context during non-blocking
commits where sleeping is strictly forbidden, can this cause kernel warnings
or deadlocks? Should this be replaced with non-sleeping delay functions like
udelay or ndelay?

[Severity: High]
This is a pre-existing issue, but it appears to be expanded here. In
drivers/gpu/drm/tve200/tve200_display.c, tve200_plane_helper_atomic_update()
and tve200_crtc_helper_atomic_enable() directly access the global state
pointers plane->state and priv->plane.state.

In non-blocking commits, these global pointers can be swapped if userspace
submits a concurrent commit. Does this create a TOCTOU race where a
concurrent commit setting the framebuffer to NULL could lead to a NULL
pointer dereference when accessing fb->format->format? Should this code use
the proper drm_atomic_get_new_plane_state() (or equivalent) accessors on the
passed state object instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com?part=8

  reply	other threads:[~2026-07-04 18:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-04 18:31 [PATCH 0/9] drm: replace simple display pipe users with atomic helpers Ze Huang
2026-07-04 18:31 ` [PATCH 1/9] drm/arcpgu: replace struct drm_simple_display_pipe with regular " Ze Huang
2026-07-04 18:43   ` sashiko-bot
2026-07-06  7:43     ` Thomas Zimmermann
2026-07-06  8:01   ` Thomas Zimmermann
2026-07-06 13:26     ` Ze Huang
2026-07-04 18:31 ` [PATCH 2/9] drm/aspeed: " Ze Huang
2026-07-04 18:52   ` sashiko-bot
2026-07-06  8:31   ` Thomas Zimmermann
2026-07-06 13:32     ` Ze Huang
2026-07-04 18:31 ` [PATCH 3/9] drm/imx: " Ze Huang
2026-07-04 18:46   ` sashiko-bot
2026-07-04 18:31 ` [PATCH 4/9] drm/mcde: " Ze Huang
2026-07-04 18:44   ` sashiko-bot
2026-07-04 18:31 ` [PATCH 5/9] drm/pl111: " Ze Huang
2026-07-04 18:45   ` sashiko-bot
2026-07-04 18:31 ` [PATCH 6/9] drm/gm12u320: " Ze Huang
2026-07-04 18:45   ` sashiko-bot
2026-07-04 18:31 ` [PATCH 7/9] drm/repaper: " Ze Huang
2026-07-04 18:31 ` [PATCH 8/9] drm/tve200: " Ze Huang
2026-07-04 18:46   ` sashiko-bot [this message]
2026-07-04 18:31 ` [PATCH 9/9] drm/xen: " Ze Huang
2026-07-04 18:53   ` sashiko-bot
2026-07-06  7:27 ` [PATCH 0/9] drm: replace simple display pipe users with " Thomas Zimmermann
2026-07-06  8:22   ` Ze Huang

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=20260704184615.466FA1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=ze.huang@oss.qualcomm.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