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: imx@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Frank.Li@kernel.org
Subject: Re: [PATCH v2 3/8] drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers
Date: Thu, 16 Jul 2026 09:21:09 +0000	[thread overview]
Message-ID: <20260716092109.A755F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260716-drm-simple-kms-removal-v2-3-1133a8fc3785@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Race condition in atomic commit causing display hang in oneshot mode due to premature hardware start.
--

--- Patch [3]: [PATCH v2 3/8] drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers ---
commit 24a767bb6a2c4adfefe9e0a5de7e9c8bbe7b2a64
Author: Ze Huang <ze.huang@oss.qualcomm.com>

drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers

Convert MCDE to explicit plane, CRTC and encoder objects. Handle pending
page-flip events from the CRTC atomic flush path using the commit-local
CRTC state.

> diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
> index 257a6e84dd583..86edf94c52372 100644
> --- a/drivers/gpu/drm/mcde/mcde_display.c
> +++ b/drivers/gpu/drm/mcde/mcde_display.c
[ ... ]
> @@ -1381,44 +1398,13 @@ static void mcde_set_extsrc(struct mcde *mcde, u32 buffer_address)
> -static void mcde_display_update(struct drm_simple_display_pipe *pipe,
> -				struct drm_plane_state *old_pstate)
> +static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
> +					    struct drm_atomic_commit *commit)
>  {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_device *drm = crtc->dev;
> -	struct mcde *mcde = to_mcde(drm);
> -	struct drm_pending_vblank_event *event = crtc->state->event;
> -	struct drm_plane *plane = &pipe->plane;
> -	struct drm_plane_state *pstate = plane->state;
> +	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
> +	struct mcde *mcde = to_mcde(plane->dev);
>  	struct drm_framebuffer *fb = pstate->fb;
>  
> -	/*
> -	 * Handle any pending event first, we need to arm the vblank
> -	 * interrupt before sending any update to the display so we don't
> -	 * miss the interrupt.
> -	 */
> -	if (event) {
[ ... ]
> -		spin_unlock_irq(&crtc->dev->event_lock);
> -	}
> -
>  	/*
>  	 * We do not start sending framebuffer updates before the
>  	 * display is enabled. Update events will however be dispatched
[ ... ]
> -static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
> +static void mcde_crtc_helper_atomic_flush(struct drm_crtc *crtc,
> +					  struct drm_atomic_commit *commit)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
> +	struct drm_pending_vblank_event *event = crtc_state->event;
> +
> +	/*
> +	 * Handle any pending event first, we need to arm the vblank
> +	 * interrupt before sending any update to the display so we don't
> +	 * miss the interrupt.
> +	 */
> +	if (!event)
> +		return;

[Severity: High]
Does this split introduce a race condition that could hang the pipeline in
oneshot mode?

Because the DRM core executes the plane's atomic_update callback before the
CRTC's atomic_flush callback, the hardware flow is now started before the
vblank event is armed.

If mcde_start_flow() is triggered during mcde_plane_helper_atomic_update()
(which happens just below the quoted block), it could complete the hardware
transfer and fire its interrupt before the vblank event gets armed later in
mcde_crtc_helper_atomic_flush().

The relocated comment in atomic_flush still notes this exact requirement:
"we need to arm the vblank interrupt before sending any update to the
display so we don't miss the interrupt."

If the interrupt fires early in oneshot mode, it will be missed, and the
atomic commit could wait indefinitely for an event that will never complete.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com?part=3

  reply	other threads:[~2026-07-16  9:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  9:01 [PATCH v2 0/8] drm: replace simple display pipe users with atomic helpers Ze Huang
2026-07-16  9:01 ` [PATCH v2 1/8] drm/arcpgu: replace struct drm_simple_display_pipe with regular " Ze Huang
2026-07-16  9:15   ` sashiko-bot
2026-07-16  9:01 ` [PATCH v2 2/8] drm/aspeed: " Ze Huang
2026-07-16  9:27   ` sashiko-bot
2026-07-16  9:01 ` [PATCH v2 3/8] drm/mcde: " Ze Huang
2026-07-16  9:21   ` sashiko-bot [this message]
2026-07-16  9:01 ` [PATCH v2 4/8] drm/pl111: " Ze Huang
2026-07-16  9:26   ` sashiko-bot
2026-07-16  9:01 ` [PATCH v2 5/8] drm/gm12u320: " Ze Huang
2026-07-16  9:14   ` sashiko-bot
2026-07-16  9:01 ` [PATCH v2 6/8] drm/repaper: " Ze Huang
2026-07-16  9:21   ` sashiko-bot
2026-07-16  9:01 ` [PATCH v2 7/8] drm/tve200: " Ze Huang
2026-07-16  9:25   ` sashiko-bot
2026-07-16  9:02 ` [PATCH v2 8/8] drm/xen: " Ze Huang
2026-07-16  9:28   ` sashiko-bot

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=20260716092109.A755F1F00A3A@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