[02/10] drm/i915/selftests: Dump engine state and trace upon hanging after reset
diff mbox series

Message ID 20200615123920.17749-2-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [01/10] drm/i915/selftests: Disable preemptive heartbeats over preemption tests
Related show

Commit Message

Chris Wilson June 15, 2020, 12:39 p.m. UTC
If the engine dies after a reset, and so we fail to submit a request
but need to be interrupted by the CI runner, dump the engine state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
index 2af66f8ffbd2..0f1be62cdc6f 100644
--- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
@@ -499,6 +499,24 @@  static int igt_reset_nop_engine(void *arg)
 
 				rq = intel_context_create_request(ce);
 				if (IS_ERR(rq)) {
+					struct drm_printer p =
+						drm_info_printer(gt->i915->drm.dev);
+					intel_engine_dump(engine, &p,
+							  "%s(%s): failed to submit request %llx:%lld\n",
+							  __func__,
+							  engine->name,
+							  rq->fence.context,
+							  rq->fence.seqno);
+
+
+					GEM_TRACE("%s(%s): failed to submit request %llx:%lld\n",
+						  __func__, engine->name,
+						  rq->fence.context,
+						  rq->fence.seqno);
+					GEM_TRACE_DUMP();
+
+					intel_gt_set_wedged(gt);
+
 					err = PTR_ERR(rq);
 					break;
 				}