[FOR_CI_v4 07/16] drm/i915/tdr: Restart submission after engine reset

Arun Siluvery arun.siluvery at linux.intel.com
Tue Jul 5 15:34:11 UTC 2016


We stop submitting requests during engine reset and recovery and there
could've been additional requests submitted during hang detection so
explicity start resubmission once we reset gpu.

Also context events drive future resubmissions but in the current
implementation we drop the request that caused the hang and so we won't
receive completion interrupt for this request hence restart submission
explicity after reset.

Signed-off-by: Arun Siluvery <arun.siluvery at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c        | 17 +++++++++++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.h |  7 +++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index ad15a7c..ea88ddb 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1149,6 +1149,23 @@ int intel_execlists_reset_preprocess(struct intel_engine_cs *engine)
 	return ret;
 }
 
+/**
+ * intel_execlists_reset_postprocess() - restarts elsp submissions after
+ * reset
+ *
+ * @engine: engine to be started
+ *
+ */
+void intel_execlists_reset_postprocess(struct intel_engine_cs *engine)
+{
+	if (list_empty(&engine->execlist_queue))
+		return;
+
+	spin_lock_bh(&engine->execlist_lock);
+	execlists_context_unqueue(engine);
+	spin_unlock_bh(&engine->execlist_lock);
+}
+
 static int intel_logical_ring_workarounds_emit(struct drm_i915_gem_request *req)
 {
 	int ret, i;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 121294c..99f0f8e 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -80,6 +80,13 @@ struct intel_ring_hangcheck {
 	enum intel_ring_hangcheck_action action;
 	int deadlock;
 	u32 instdone[I915_NUM_INSTDONE_REG];
+
+	/*
+	 * Last recorded ring head index.
+	 * This is only ever a ring index where as active
+	 * head may be a graphics address in a ring buffer
+	 */
+	u32 last_head;
 };
 
 struct intel_ringbuffer {
-- 
1.9.1



More information about the Intel-gfx-trybot mailing list