[PATCH] i915: reduce scope of irq disable when signaling breadcrumbs
From: Clark Williams
Date: Wed Aug 21 2019 - 12:33:26 EST
From: Clark Williams <williams@xxxxxxxxxx>
Rather than disable irqs around the call to intel_engine_breadcrumbs_irq()
use raw_spin_lock_irq() around the signalers loop inside
intel_engine_breadcrumbs_irq().
It's entirely possible that we only need local_irq_{disable, enable} around
the call to __intel_breadcrumbs_disarm_irq() but for now just use the
raw_spin_lock_irq() call to disable irqs (and preemption).
This prevents a debug splat on PREEMPT_RT where the request lock is taken
in atomic context.
Signed-off-by: Clark Williams <williams@xxxxxxxxxx>
---
drivers/gpu/drm/i915/intel_breadcrumbs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index 32ebbe887e61..b393421ddf06 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -119,7 +119,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
struct list_head *pos, *next;
LIST_HEAD(signal);
- raw_spin_lock(&b->irq_lock);
+ raw_spin_lock_irq(&b->irq_lock);
if (b->irq_armed && list_empty(&b->signalers))
__intel_breadcrumbs_disarm_irq(b);
@@ -163,7 +163,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
}
}
- raw_spin_unlock(&b->irq_lock);
+ raw_spin_unlock_irq(&b->irq_lock);
list_for_each_safe(pos, next, &signal) {
struct i915_request *rq =
@@ -181,9 +181,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine)
{
- local_irq_disable();
intel_engine_breadcrumbs_irq(engine);
- local_irq_enable();
}
static void signal_irq_work(struct irq_work *work)
--
2.21.0