All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915/selftests: Include the trace as a debug aide
@ 2018-03-22  7:35 Chris Wilson
  2018-03-22  7:35 ` [PATCH 2/4] drm/i915/selftests: Stress resets-vs-request-priority Chris Wilson
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Chris Wilson @ 2018-03-22  7:35 UTC (permalink / raw)
  To: intel-gfx

If we fail to reset the GPU in a timely fashion, dump the GEM trace so
that we can see what operations were in flight when the GPU got stuck.

v2: There's more than one timeout that deserves tracing!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
index 4372826998aa..1969a65072ca 100644
--- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
@@ -260,8 +260,11 @@ static void wedge_me(struct work_struct *work)
 {
 	struct wedge_me *w = container_of(work, typeof(*w), work.work);
 
-	pr_err("%pS timed out, cancelling all further testing.\n",
-	       w->symbol);
+	pr_err("%pS timed out, cancelling all further testing.\n", w->symbol);
+
+	GEM_TRACE("%pS timed out.\n", w->symbol);
+	GEM_TRACE_DUMP();
+
 	i915_gem_set_wedged(w->i915);
 }
 
@@ -621,9 +624,19 @@ static int active_engine(void *data)
 		mutex_unlock(&engine->i915->drm.struct_mutex);
 
 		if (old) {
-			i915_request_wait(old, 0, MAX_SCHEDULE_TIMEOUT);
+			if (i915_request_wait(old, 0, 10*HZ) < 0) {
+				GEM_TRACE("%s timed out.\n", engine->name);
+				GEM_TRACE_DUMP();
+
+				i915_gem_set_wedged(engine->i915);
+				i915_request_put(old);
+				err = -EIO;
+				break;
+			}
 			i915_request_put(old);
 		}
+
+		cond_resched();
 	}
 
 	for (count = 0; count < ARRAY_SIZE(rq); count++)
@@ -1126,6 +1139,10 @@ int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
 
 	err = i915_subtests(tests, i915);
 
+	mutex_lock(&i915->drm.struct_mutex);
+	flush_test(i915, I915_WAIT_LOCKED);
+	mutex_unlock(&i915->drm.struct_mutex);
+
 	i915_modparams.enable_hangcheck = saved_hangcheck;
 	intel_runtime_pm_put(i915);
 
-- 
2.16.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-03-31  8:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22  7:35 [PATCH 1/4] drm/i915/selftests: Include the trace as a debug aide Chris Wilson
2018-03-22  7:35 ` [PATCH 2/4] drm/i915/selftests: Stress resets-vs-request-priority Chris Wilson
2018-03-22  7:35 ` [PATCH 3/4] drm/i915: Use full serialisation around engine->irq_posted Chris Wilson
2018-03-22 14:35   ` Mika Kuoppala
2018-03-22 15:34   ` Jeff McGee
2018-03-22 17:01     ` Chris Wilson
2018-03-30 23:08   ` Chris Wilson
2018-03-31  8:59     ` Chris Wilson
2018-03-22  7:35 ` [PATCH 4/4] drm/i915: Flush pending interrupt following a GPU reset Chris Wilson
2018-03-22  7:43 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915/selftests: Include the trace as a debug aide Patchwork
2018-03-22  7:49 ` [PATCH v2] " Chris Wilson
2018-03-22 14:26   ` Mika Kuoppala
2018-03-22 14:30     ` Chris Wilson
2018-03-22 19:29       ` Jeff McGee
2018-03-22 20:37         ` Chris Wilson
2018-03-22  7:58 ` ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
2018-03-22  8:02 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2] drm/i915/selftests: Include the trace as a debug aide (rev2) Patchwork
2018-03-22  8:19 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-22 10:23 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.