[Intel-gfx] [PATCH v2] drm/i915: Show HWSP in intel_engine_dump()

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 22 17:28:44 UTC 2017


Looking at a CI failure with an ominous line of
[  362.550715] hangcheck current seqno ffffff6b, last ffffff8c, hangcheck ffffff6b [6016 ms], inflight 118
with no apparent cause for the seqno to be negative, left me wondering
if someone had scribbled over the HWSP. So include the HWSP in the
engine dump to see if there are more signs of random scribbling.

v2: Fix row pointer, i is now incremented by 8 so doesn't need scaling
by 8, and we don't need to keep volatile here as the status_page isn't
marked up as volatile itself.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 9856e24c7c43..362dd74ea9f5 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1679,6 +1679,7 @@ void intel_engine_dump(struct intel_engine_cs *engine,
 	struct rb_node *rb;
 	char hdr[80];
 	u64 addr;
+	int i;
 
 	if (header) {
 		va_list ap;
@@ -1869,8 +1870,17 @@ void intel_engine_dump(struct intel_engine_cs *engine,
 				  &engine->irq_posted)),
 		   yesno(test_bit(ENGINE_IRQ_EXECLIST,
 				  &engine->irq_posted)));
+
+	drm_printf(m, "\tHWSP:\n");
+	for (i = 0; i < PAGE_SIZE / sizeof(u32); i += 8) {
+		u32 *row = engine->status_page.page_addr + i;
+
+		drm_printf(m, "\t%08x %08x %08x %08x %08x %08x %08x %08x\n",
+			   row[0], row[1], row[2], row[3],
+			   row[4], row[5], row[6], row[7]);
+	}
+
 	drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine)));
-	drm_printf(m, "\n");
 }
 
 static u8 user_class_map[] = {
-- 
2.15.1



More information about the Intel-gfx mailing list