Commit aebbc2d7 authored by Chris Wilson's avatar Chris Wilson

drm/i915/execlists: Move irq state manipulation inside irq disabled region

Although this state (execlists->active and engine->irq_posted) itself is
not protected by the engine->timeline spinlock, it does conveniently
ensure that irqs are disabled. We can use this to protect our
manipulation of the state and so ensure that the next IRQ to arrive sees
consistent state and (hopefully) ignores the reset engine.
Suggested-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302131246.22036-1-chris@chris-wilson.co.uk
parent 963ddd63
...@@ -1618,10 +1618,10 @@ static void reset_common_ring(struct intel_engine_cs *engine, ...@@ -1618,10 +1618,10 @@ static void reset_common_ring(struct intel_engine_cs *engine,
GEM_TRACE("%s seqno=%x\n", GEM_TRACE("%s seqno=%x\n",
engine->name, request ? request->global_seqno : 0); engine->name, request ? request->global_seqno : 0);
reset_irq(engine);
spin_lock_irqsave(&engine->timeline->lock, flags); spin_lock_irqsave(&engine->timeline->lock, flags);
reset_irq(engine);
/* /*
* Catch up with any missed context-switch interrupts. * Catch up with any missed context-switch interrupts.
* *
...@@ -1636,11 +1636,11 @@ static void reset_common_ring(struct intel_engine_cs *engine, ...@@ -1636,11 +1636,11 @@ static void reset_common_ring(struct intel_engine_cs *engine,
/* Push back any incomplete requests for replay after the reset. */ /* Push back any incomplete requests for replay after the reset. */
__unwind_incomplete_requests(engine); __unwind_incomplete_requests(engine);
spin_unlock_irqrestore(&engine->timeline->lock, flags);
/* Mark all CS interrupts as complete */ /* Mark all CS interrupts as complete */
execlists->active = 0; execlists->active = 0;
spin_unlock_irqrestore(&engine->timeline->lock, flags);
/* If the request was innocent, we leave the request in the ELSP /* If the request was innocent, we leave the request in the ELSP
* and will try to replay it on restarting. The context image may * and will try to replay it on restarting. The context image may
* have been corrupted by the reset, in which case we may have * have been corrupted by the reset, in which case we may have
......
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