All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maarten Lankhorst" <dev@lankhorst.se>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/7] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock()
Date: Fri, 03 Jul 2026 11:48:00 +0000	[thread overview]
Message-ID: <20260703114800.D02311F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260703113259.801374-2-dev@lankhorst.se>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Re-enabling interrupts before `execlists_submit_ports()` violates the hardware ELSP submission constraint and causes premature `irq_work` flushing, breaking cross-engine request execution ordering.
--

commit 2338d7dc7111f08419fa617c233f6984399c8937
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock()

This patch modifies execlists_dequeue() to use spin_lock_irq() and 
spin_unlock_irq() directly. It removes execlists_dequeue_irq() which 
previously wrapped the entire dequeue operation in local_irq_disable().

> diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> index 1359fc9cb88ef..e11db81dca9c5 100644
> --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c

[ ... ]

> @@ -1588,7 +1588,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  	 */
>  	sched_engine->queue_priority_hint = queue_prio(sched_engine);
>  	i915_sched_engine_reset_on_empty(sched_engine);
> -	spin_unlock(&sched_engine->lock);
> +	spin_unlock_irq(&sched_engine->lock);

[Severity: High]
Does re-enabling interrupts here before calling execlists_submit_ports() 
violate the hardware ELSP submission constraints?

The original execlists_dequeue_irq() kept interrupts disabled across the
entire dequeue process, including the final MMIO writes. By changing to
spin_unlock_irq() here, interrupts are re-enabled before the execution of:

execlists_submit_ports() {
    ...
    for (n = execlists_num_ports(execlists); n--; ) {
        struct i915_request *rq = execlists->pending[n];

        write_desc(execlists,
                   rq ? execlists_update_context(rq) : 0,
                   n);
    }
}

Hardware requires these consecutive ELSP MMIO writes to be atomic without
intervening accesses. If an interrupt fires during this loop, could it
corrupt the submission sequence and cause a GPU hang? 

Additionally, can enabling interrupts this early cause premature irq_work
flushing, breaking cross-engine request execution ordering?

>  
>  	/*
>  	 * We can skip poking the HW if we ended up with exactly the same set

[ ... ]

> -static void execlists_dequeue_irq(struct intel_engine_cs *engine)
> -{
> -	local_irq_disable(); /* Suspend interrupts across request submission */
> -	execlists_dequeue(engine);
> -	local_irq_enable(); /* flush irq_work (e.g. breadcrumb enabling) */
> -}
> -

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260703113259.801374-1-dev@lankhorst.se?part=1

  reply	other threads:[~2026-07-03 11:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 11:32 [PATCH v2 0/7] drm/i915: All fixes to make i915 work well with PREEMPT_RT Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 1/7] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Maarten Lankhorst
2026-07-03 11:48   ` sashiko-bot [this message]
2026-07-03 11:32 ` [PATCH v2 2/7] drm/i915: Drop the irqs_disabled() check Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 3/7] drm/i915/guc: Consider also RCU depth in busy loop Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 4/7] drm/i915/gt: Fix selftests on PREEMPT_RT Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 5/7] drm/i915/gt: Set stop_timeout() correctly on PREEMPT-RT Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 6/7] drm/i915: Use sleeping selftests for igt_atomic on PREEMPT_RT Maarten Lankhorst
2026-07-03 11:32 ` [PATCH v2 7/7] drm/i915/gt: Use a spinlock to prevent starvation of irq_work Maarten Lankhorst
2026-07-03 11:43   ` sashiko-bot
2026-07-03 12:35 ` ✗ i915.CI.BAT: failure for drm/i915: All fixes to make i915 work well with PREEMPT_RT. (rev2) Patchwork

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=20260703114800.D02311F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dev@lankhorst.se \
    --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.