[PATCH 3/6] drm/i915: Check for a stuck waiter before a missed interrupt

Chris Wilson chris at chris-wilson.co.uk
Sun Jul 24 09:11:59 UTC 2016


As the interrupt wakeup counter only increments when we have a waiter,
before testing to see if that counter is unchanged we have to first
check that we do expect it to change (i.e. we have a waiter).

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_irq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 7104dc1463eb..f4e7acb97731 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3062,7 +3062,9 @@ static unsigned long kick_waiters(struct intel_engine_cs *engine)
 	struct drm_i915_private *i915 = engine->i915;
 	unsigned long irq_count = READ_ONCE(engine->breadcrumbs.irq_wakeups);
 
+	rcu_read_lock();
 	if (engine->hangcheck.user_interrupts == irq_count &&
+	    intel_engine_wakeup(engine) &&
 	    !test_and_set_bit(engine->id, &i915->gpu_error.missed_irq_rings)) {
 		if (!test_bit(engine->id, &i915->gpu_error.test_irq_rings))
 			DRM_ERROR("Hangcheck timer elapsed... %s idle\n",
@@ -3070,6 +3072,7 @@ static unsigned long kick_waiters(struct intel_engine_cs *engine)
 
 		intel_engine_enable_fake_irq(engine);
 	}
+	rcu_read_unlock();
 
 	return irq_count;
 }
-- 
2.8.1



More information about the Intel-gfx-trybot mailing list