Commit e3b017d5 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior
Browse files

drm/i915/gt: Queue and wait for the irq_work item.



Disabling interrupts and invoking the irq_work function directly breaks
on PREEMPT_RT.
PREEMPT_RT does not invoke all irq_work from hardirq context because
some of the user have spinlock_t locking in the callback function.
These locks are then turned into a sleeping locks which can not be
acquired with disabled interrupts.

Using irq_work_queue() has the benefit that the irqwork will be invoked
in the regular context. In general there is "no" delay between enqueuing
the callback and its invocation because the interrupt is raised right
away on architectures which support it (which includes x86).

Use irq_work_queue() + irq_work_sync() instead invoking the callback
directly.
Reported-by: default avatarClark Williams <williams@redhat.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
parent 397d3f0d
...@@ -318,10 +318,9 @@ void __intel_breadcrumbs_park(struct intel_breadcrumbs *b) ...@@ -318,10 +318,9 @@ void __intel_breadcrumbs_park(struct intel_breadcrumbs *b)
/* Kick the work once more to drain the signalers, and disarm the irq */ /* Kick the work once more to drain the signalers, and disarm the irq */
irq_work_sync(&b->irq_work); irq_work_sync(&b->irq_work);
while (READ_ONCE(b->irq_armed) && !atomic_read(&b->active)) { while (READ_ONCE(b->irq_armed) && !atomic_read(&b->active)) {
local_irq_disable(); irq_work_queue(&b->irq_work);
signal_irq_work(&b->irq_work);
local_irq_enable();
cond_resched(); cond_resched();
irq_work_sync(&b->irq_work);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment