Commit fff8102a authored by Chris Wilson's avatar Chris Wilson

drm/i915/execlists: Process interrupted context on reset

By stopping the rings, we may trigger an arbitration point resulting in
a premature context-switch (i.e. a completion event before the request
is actually complete). This clears the active context before the reset,
but we must remember to rewind the incomplete context for replay upon
resume.

Fixes: 1863e302 ("drm/i915/execlists: Always reset the context's RING registers")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190716124931.5870-3-chris@chris-wilson.co.uk
parent 0629d4da
...@@ -1425,7 +1425,8 @@ static void process_csb(struct intel_engine_cs *engine) ...@@ -1425,7 +1425,8 @@ static void process_csb(struct intel_engine_cs *engine)
* coherent (visible from the CPU) before the * coherent (visible from the CPU) before the
* user interrupt and CSB is processed. * user interrupt and CSB is processed.
*/ */
GEM_BUG_ON(!i915_request_completed(*execlists->active)); GEM_BUG_ON(!i915_request_completed(*execlists->active) &&
!reset_in_progress(execlists));
execlists_schedule_out(*execlists->active++); execlists_schedule_out(*execlists->active++);
GEM_BUG_ON(execlists->active - execlists->inflight > GEM_BUG_ON(execlists->active - execlists->inflight >
...@@ -2251,7 +2252,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled) ...@@ -2251,7 +2252,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
*/ */
rq = execlists_active(execlists); rq = execlists_active(execlists);
if (!rq) if (!rq)
return; goto unwind;
ce = rq->hw_context; ce = rq->hw_context;
GEM_BUG_ON(i915_active_is_idle(&ce->active)); GEM_BUG_ON(i915_active_is_idle(&ce->active));
...@@ -2328,6 +2329,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled) ...@@ -2328,6 +2329,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
intel_ring_update_space(ce->ring); intel_ring_update_space(ce->ring);
__execlists_update_reg_state(ce, engine); __execlists_update_reg_state(ce, engine);
unwind:
/* 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);
} }
......
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