[PATCH 1/2] drm/i915: Don't disable interrupts for intel_engine_breadcrumbs_irq()

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 26 17:26:12 UTC 2019

Quoting Sebastian Andrzej Siewior (2019-09-26 11:56:43)
> The function intel_engine_breadcrumbs_irq() is always invoked from an interrupt
> handler and for that reason it invokes (as an optimisation) only spin_lock()
> for locking assuming that the interrupts are already disabled. The
> function intel_engine_signal_breadcrumbs() is provided to disable
> interrupts while the former function is invoked so that assumption is
> also true for callers from preemptible context.
> On PREEMPT_RT local_irq_disable() really disables interrupts and this
> forbids to invoke spin_lock() which becomes a sleeping spinlock.
> This is also problematic with `threadirqs' in conjunction with
> irq_work. With force threading the interrupt handler, the handler is
> invoked with disabled BH but with interrupts enabled. This is okay and
> the lock itself is never acquired in IRQ context. This changes with
> irq_work (signal_irq_work()) which _still_ invokes
> intel_engine_breadcrumbs_irq() from IRQ context. Lockdep should see this
> and complain.
> Acquire the locks in intel_engine_breadcrumbs_irq() with _irqsave()
> suffix and let all callers invoke intel_engine_breadcrumbs_irq()
> directly instead using intel_engine_signal_breadcrumbs().
> Reported-by: Clark Williams <williams at redhat.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

All those irq save/restore look annoying, still the argument is valid
Reviewed: Chris Wilson <chris at chris-wilson.co.uk>

More information about the dri-devel mailing list