diff options
Diffstat (limited to 'debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch')
-rw-r--r-- | debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch index a54bf1710..2dd57b8e1 100644 --- a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch +++ b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-for-intel_engine_b.patch @@ -1,8 +1,8 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 25 Sep 2019 16:04:11 +0200 +Date: Thu, 26 Sep 2019 12:29:05 +0200 Subject: [PATCH] drm/i915: Don't disable interrupts for intel_engine_breadcrumbs_irq() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.17-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz 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() @@ -12,7 +12,7 @@ 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 acquire spin_lock() which becomes a sleeping spinlock. +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 @@ -29,26 +29,15 @@ directly instead using intel_engine_signal_breadcrumbs(). Reported-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/gpu/drm/i915/i915_reset.c | 2 +- - drivers/gpu/drm/i915/intel_breadcrumbs.c | 16 +++++----------- - drivers/gpu/drm/i915/intel_hangcheck.c | 2 +- - drivers/gpu/drm/i915/intel_ringbuffer.h | 1 - + drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 16 +++++----------- + drivers/gpu/drm/i915/gt/intel_engine.h | 1 - + drivers/gpu/drm/i915/gt/intel_hangcheck.c | 2 +- + drivers/gpu/drm/i915/gt/intel_reset.c | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) ---- a/drivers/gpu/drm/i915/i915_reset.c -+++ b/drivers/gpu/drm/i915/i915_reset.c -@@ -804,7 +804,7 @@ static void reset_finish(struct drm_i915 - - for_each_engine(engine, i915, id) { - reset_finish_engine(engine); -- intel_engine_signal_breadcrumbs(engine); -+ intel_engine_breadcrumbs_irq(engine); - } - } - ---- a/drivers/gpu/drm/i915/intel_breadcrumbs.c -+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c -@@ -116,9 +116,10 @@ void intel_engine_breadcrumbs_irq(struct +--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c ++++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +@@ -134,9 +134,10 @@ void intel_engine_breadcrumbs_irq(struct const ktime_t timestamp = ktime_get(); struct intel_context *ce, *cn; struct list_head *pos, *next; @@ -60,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (b->irq_armed && list_empty(&b->signalers)) __intel_breadcrumbs_disarm_irq(b); -@@ -162,7 +163,7 @@ void intel_engine_breadcrumbs_irq(struct +@@ -182,30 +183,23 @@ void intel_engine_breadcrumbs_irq(struct } } @@ -69,13 +58,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_for_each_safe(pos, next, &signal) { struct i915_request *rq = -@@ -170,21 +171,14 @@ void intel_engine_breadcrumbs_irq(struct - - __dma_fence_signal__timestamp(&rq->fence, timestamp); + list_entry(pos, typeof(*rq), signal_link); + struct list_head cb_list; - spin_lock(&rq->lock); + spin_lock_irqsave(&rq->lock, flags); - __dma_fence_signal__notify(&rq->fence); + list_replace(&rq->fence.cb_list, &cb_list); + __dma_fence_signal__timestamp(&rq->fence, timestamp); + __dma_fence_signal__notify(&rq->fence, &cb_list); - spin_unlock(&rq->lock); + spin_unlock_irqrestore(&rq->lock, flags); @@ -93,10 +83,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void signal_irq_work(struct irq_work *work) { struct intel_engine_cs *engine = ---- a/drivers/gpu/drm/i915/intel_hangcheck.c -+++ b/drivers/gpu/drm/i915/intel_hangcheck.c -@@ -275,7 +275,7 @@ static void i915_hangcheck_elapsed(struc - for_each_engine(engine, dev_priv, id) { +--- a/drivers/gpu/drm/i915/gt/intel_engine.h ++++ b/drivers/gpu/drm/i915/gt/intel_engine.h +@@ -349,7 +349,6 @@ void intel_engine_init_execlists(struct + void intel_engine_init_breadcrumbs(struct intel_engine_cs *engine); + void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine); + +-void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine); + void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine); + + static inline void +--- a/drivers/gpu/drm/i915/gt/intel_hangcheck.c ++++ b/drivers/gpu/drm/i915/gt/intel_hangcheck.c +@@ -283,7 +283,7 @@ static void hangcheck_elapsed(struct wor + for_each_engine(engine, gt->i915, id) { struct hangcheck hc; - intel_engine_signal_breadcrumbs(engine); @@ -104,13 +104,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hangcheck_load_sample(engine, &hc); hangcheck_accumulate_sample(engine, &hc); ---- a/drivers/gpu/drm/i915/intel_ringbuffer.h -+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h -@@ -388,7 +388,6 @@ void intel_engine_fini_breadcrumbs(struc - void intel_engine_pin_breadcrumbs_irq(struct intel_engine_cs *engine); - void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine); +--- a/drivers/gpu/drm/i915/gt/intel_reset.c ++++ b/drivers/gpu/drm/i915/gt/intel_reset.c +@@ -695,7 +695,7 @@ static void reset_finish_engine(struct i + engine->reset.finish(engine); + intel_uncore_forcewake_put(engine->uncore, FORCEWAKE_ALL); --void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine); - void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine); +- intel_engine_signal_breadcrumbs(engine); ++ intel_engine_breadcrumbs_irq(engine); + } - static inline void + static void reset_finish(struct intel_gt *gt, intel_engine_mask_t awake) |