[Intel-gfx] [PATCH] drm/i915: Restore interrupt enabling after a reset

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 15 22:03:55 UTC 2019


At least on i965g and i965gm, performing a device reset clobbers the IER
resulting in loss of interrupts thereafter. So, run the irq_postinstall
hook to restore them.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
This feels a bit hairy, so maybe limit it to
INTEL_INFO()->reset_clobbers_display? Or even introduce
reset_clobbers_interrupt with the same platforms as clobbers_display?
-Chris
---
 drivers/gpu/drm/i915/i915_reset.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_reset.c b/drivers/gpu/drm/i915/i915_reset.c
index 5a067a4b3d5d..451233709d1a 100644
--- a/drivers/gpu/drm/i915/i915_reset.c
+++ b/drivers/gpu/drm/i915/i915_reset.c
@@ -675,8 +675,14 @@ static int gt_reset(struct drm_i915_private *i915, unsigned int stalled_mask)
 {
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
+	unsigned long flags;
 	int err;
 
+	/* Restore IER as it may get clobbered on some platforms! (i965g[m]) */
+	spin_lock_irqsave(&i915->irq_lock, flags);
+	i915->drm.driver->irq_postinstall(&i915->drm);
+	spin_unlock_irqrestore(&i915->irq_lock, flags);
+
 	/*
 	 * Everything depends on having the GTT running, so we need to start
 	 * there.
@@ -690,7 +696,7 @@ static int gt_reset(struct drm_i915_private *i915, unsigned int stalled_mask)
 
 	i915_gem_restore_fences(i915);
 
-	return err;
+	return 0;
 }
 
 static void reset_finish_engine(struct intel_engine_cs *engine)
-- 
2.20.1



More information about the Intel-gfx mailing list