Skip to contentSkip to conversation

drm/i915: Cleanup instdone collection

PATCH RESEND In review Imre Deak 2 participants 4 messages Sep 20, 2016 – Sep 21, 2016

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH RESEND v2 1/2 drm/i915: Cleanup instdone collection

From: Ben Widawsky <[email protected]>

Consolidate the instdone logic so we can get a bit fancier. This patch also removes the duplicated print of INSTDONE[0].

v2: (Imre)
- Rebased on top of hangcheck INSTDONE changes.
- Move all INSTDONE registers into a single struct, store it within the engine error struct during error capturing.

---
 drivers/gpu/drm/i915/i915_debugfs.c     | 41 +++++++++++-----
 drivers/gpu/drm/i915/i915_drv.h         |  8 ++--
 drivers/gpu/drm/i915/i915_gpu_error.c   | 84 +++++++++++++++++++++++----------
 drivers/gpu/drm/i915/i915_irq.c         | 69 ++++++++++++++++++---------
 drivers/gpu/drm/i915/i915_reg.h         |  1 -
 drivers/gpu/drm/i915/intel_ringbuffer.h | 10 +++-
 6 files changed, 151 insertions(+), 62 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +29 -12
index a6d174a..ba155c0 100644
@@ -1277,15 +1277,36 @@ out:
 	return ret;
 }
 
+static void i915_instdone_info(struct drm_i915_private *dev_priv,
+			       struct seq_file *m,
+			       struct intel_instdone *instdone)
+{
+	seq_printf(m, "\t\tINSTDONE: 0x%08x\n",
+		   instdone->instdone);
+
+	if (INTEL_GEN(dev_priv) <= 3)
+		return;
+
+	seq_printf(m, "\t\tSC_INSTDONE: 0x%08x\n",
+		   instdone->slice_common);
+
+	if (INTEL_GEN(dev_priv) <= 6)
+		return;
+
+	seq_printf(m, "\t\tSAMPLER_INSTDONE: 0x%08x\n",
+		   instdone->sampler);
+	seq_printf(m, "\t\tROW_INSTDONE: 0x%08x\n",
+		   instdone->row);
+}
+
 static int i915_hangcheck_info(struct seq_file *m, void *unused)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
 	struct intel_engine_cs *engine;
 	u64 acthd[I915_NUM_ENGINES];
 	u32 seqno[I915_NUM_ENGINES];
-	u32 instdone[I915_NUM_INSTDONE_REG];
+	struct intel_instdone instdone;
 	enum intel_engine_id id;
-	int j;
 
 	if (test_bit(I915_WEDGED, &dev_priv->gpu_error.flags))
 		seq_printf(m, "Wedged\n");
@@ -1308,7 +1329,7 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
 		seqno[id] = intel_engine_get_seqno(engine);
 	}
 
-	i915_get_extra_instdone(dev_priv, instdone);
+	i915_get_engine_instdone(dev_priv, RCS, &instdone);
 
 	intel_runtime_pm_put(dev_priv);
 
@@ -1336,18 +1357,14 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
 		seq_printf(m, "\taction = %d\n", engine->hangcheck.action);
 
 		if (engine->id == RCS) {
-			seq_puts(m, "\tinstdone read =");
+			seq_puts(m, "\tinstdone read =\n");
 
-			for (j = 0; j < I915_NUM_INSTDONE_REG; j++)
-				seq_printf(m, " 0x%08x", instdone[j]);
+			i915_instdone_info(dev_priv, m, &instdone);
 
-			seq_puts(m, "\n\tinstdone accu =");
+			seq_puts(m, "\tinstdone accu =\n");
 
-			for (j = 0; j < I915_NUM_INSTDONE_REG; j++)
-				seq_printf(m, " 0x%08x",
-					   engine->hangcheck.instdone[j]);
-
-			seq_puts(m, "\n");
+			i915_instdone_info(dev_priv, m,
+					   &engine->hangcheck.instdone);
 		}
 	}
 
drivers/gpu/drm/i915/i915_drv.h +5 -3
index 4dd307e..3568995 100644
@@ -759,7 +759,7 @@ struct drm_i915_error_state {
 	u32 gam_ecochk;
 	u32 gab_ctl;
 	u32 gfx_mode;
-	u32 extra_instdone[I915_NUM_INSTDONE_REG];
+
 	u64 fence[I915_MAX_NUM_FENCES];
 	struct intel_overlay_error_state *overlay;
 	struct intel_display_error_state *display;
@@ -791,7 +791,6 @@ struct drm_i915_error_state {
 		u32 hws;
 		u32 ipeir;
 		u32 ipehr;
-		u32 instdone;
 		u32 bbstate;
 		u32 instpm;
 		u32 instps;
@@ -802,6 +801,7 @@ struct drm_i915_error_state {
 		u64 faddr;
 		u32 rc_psmi; /* sleep state */
 		u32 semaphore_mboxes[I915_NUM_ENGINES - 1];
+		struct intel_instdone instdone;
 
 		struct drm_i915_error_object {
 			int page_count;
@@ -3542,7 +3542,9 @@ void i915_error_state_get(struct drm_device *dev,
 void i915_error_state_put(struct i915_error_state_file_priv *error_priv);
 void i915_destroy_error_state(struct drm_device *dev);
 
-void i915_get_extra_instdone(struct drm_i915_private *dev_priv, uint32_t *instdone);
+void i915_get_engine_instdone(struct drm_i915_private *dev_priv,
+			      enum intel_engine_id engine_id,
+			      struct intel_instdone *instdone);
 const char *i915_cache_level_str(struct drm_i915_private *i915, int type);
 
 /* i915_cmd_parser.c */
drivers/gpu/drm/i915/i915_gpu_error.c +60 -24

134 lines not on this page · raw message

drivers/gpu/drm/i915/i915_irq.c +48 -21

127 lines not on this page · raw message

drivers/gpu/drm/i915/i915_reg.h +0 -1
index 70d9616..4133145 100644
@@ -1708,7 +1708,6 @@ enum skl_disp_power_wells {
 #define GEN7_SC_INSTDONE	_MMIO(0x7100)
 #define GEN7_SAMPLER_INSTDONE	_MMIO(0xe160)
 #define GEN7_ROW_INSTDONE	_MMIO(0xe164)
-#define I915_NUM_INSTDONE_REG	4
 #define RING_IPEIR(base)	_MMIO((base)+0x64)
 #define RING_IPEHR(base)	_MMIO((base)+0x68)
 /*
drivers/gpu/drm/i915/intel_ringbuffer.h +9 -1
index 7f64d61..4ff4702 100644
@@ -73,13 +73,21 @@ enum intel_engine_hangcheck_action {
 
 #define HANGCHECK_SCORE_RING_HUNG 31
 
+struct intel_instdone {
+	u32 instdone;
+	/* The following exist only in the RCS engine */
+	u32 slice_common;
+	u32 sampler;
+	u32 row;
+};
+
 struct intel_engine_hangcheck {
 	u64 acthd;
 	u32 seqno;
 	int score;
 	enum intel_engine_hangcheck_action action;
 	int deadlock;
-	u32 instdone[I915_NUM_INSTDONE_REG];
+	struct intel_instdone instdone;
 };
 
 struct intel_ring {
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw

PATCH RESEND v2 2/2 drm/i915: Try to print INSTDONE bits for all slice/subslice

From: Ben Widawsky <[email protected]>

v2: (Imre)
- Access only subslices that are known to exist.
- Reset explictly the MCR selector to slice/sub-slice ID 0 after the readout.
- Use the subslice INSTDONE bits for the hangcheck/subunits-stuck detection too.
- Take the uncore lock for the MCR-select/subslice-readout sequence.

---
 drivers/gpu/drm/i915/i915_debugfs.c     | 14 ++++--
 drivers/gpu/drm/i915/i915_gpu_error.c   | 76 ++++++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/i915_irq.c         | 25 ++++++++---
 drivers/gpu/drm/i915/i915_reg.h         |  5 +++
 drivers/gpu/drm/i915/intel_ringbuffer.h | 23 +++++++++-
 5 files changed, 125 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +10 -4
index ba155c0..d3f83c5 100644
@@ -1281,6 +1281,9 @@ static void i915_instdone_info(struct drm_i915_private *dev_priv,
 			       struct seq_file *m,
 			       struct intel_instdone *instdone)
 {
+	int slice;
+	int subslice;
+
 	seq_printf(m, "\t\tINSTDONE: 0x%08x\n",
 		   instdone->instdone);
 
@@ -1293,10 +1296,13 @@ static void i915_instdone_info(struct drm_i915_private *dev_priv,
 	if (INTEL_GEN(dev_priv) <= 6)
 		return;
 
-	seq_printf(m, "\t\tSAMPLER_INSTDONE: 0x%08x\n",
-		   instdone->sampler);
-	seq_printf(m, "\t\tROW_INSTDONE: 0x%08x\n",
-		   instdone->row);
+	for_each_instdone_slice_subslice(dev_priv, slice, subslice)
+		seq_printf(m, "\t\tSAMPLER_INSTDONE[%d][%d]: 0x%08x\n",
+			   slice, subslice, instdone->sampler[slice][subslice]);
+
+	for_each_instdone_slice_subslice(dev_priv, slice, subslice)
+		seq_printf(m, "\t\tROW_INSTDONE[%d][%d]: 0x%08x\n",
+			   slice, subslice, instdone->row[slice][subslice]);
 }
 
 static int i915_hangcheck_info(struct seq_file *m, void *unused)
drivers/gpu/drm/i915/i915_gpu_error.c +70 -6

106 lines not on this page · raw message

drivers/gpu/drm/i915/i915_irq.c +19 -6
index 371647c..a5c02f6 100644
@@ -2549,6 +2549,9 @@ static inline void
 i915_err_print_instdone(struct drm_i915_private *dev_priv,
 			struct intel_instdone *instdone)
 {
+	int slice;
+	int subslice;
+
 	pr_err("  INSTDONE: 0x%08x\n", instdone->instdone);
 
 	if (INTEL_GEN(dev_priv) <= 3)
@@ -2559,8 +2562,13 @@ i915_err_print_instdone(struct drm_i915_private *dev_priv,
 	if (INTEL_GEN(dev_priv) <= 6)
 		return;
 
-	pr_err("  SAMPLER_INSTDONE: 0x%08x\n", instdone->sampler);
-	pr_err("  ROW_INSTDONE: 0x%08x\n", instdone->row);
+	for_each_instdone_slice_subslice(dev_priv, slice, subslice)
+		pr_err("  SAMPLER_INSTDONE[%d][%d]: 0x%08x\n",
+		       slice, subslice, instdone->sampler[slice][subslice]);
+
+	for_each_instdone_slice_subslice(dev_priv, slice, subslice)
+		pr_err("  ROW_INSTDONE[%d][%d]: 0x%08x\n",
+		       slice, subslice, instdone->row[slice][subslice]);
 }
 
 static void i915_report_and_clear_eir(struct drm_i915_private *dev_priv)
@@ -2981,6 +2989,8 @@ static bool subunits_stuck(struct intel_engine_cs *engine)
 	struct intel_instdone instdone;
 	struct intel_instdone *accu_instdone = &engine->hangcheck.instdone;
 	bool stuck;
+	int slice;
+	int subslice;
 
 	if (engine->id != RCS)
 		return true;
@@ -2996,10 +3006,13 @@ static bool subunits_stuck(struct intel_engine_cs *engine)
 				   &accu_instdone->instdone);
 	stuck &= instdone_unchanged(instdone.slice_common,
 				    &accu_instdone->slice_common);
-	stuck &= instdone_unchanged(instdone.sampler,
-				    &accu_instdone->sampler);
-	stuck &= instdone_unchanged(instdone.row,
-				    &accu_instdone->row);
+
+	for_each_instdone_slice_subslice(dev_priv, slice, subslice) {
+		stuck &= instdone_unchanged(instdone.sampler[slice][subslice],
+					    &accu_instdone->sampler[slice][subslice]);
+		stuck &= instdone_unchanged(instdone.row[slice][subslice],
+					    &accu_instdone->row[slice][subslice]);
+	}
 
 	return stuck;
 }
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 4133145..8d44cee 100644
@@ -1708,6 +1708,11 @@ enum skl_disp_power_wells {
 #define GEN7_SC_INSTDONE	_MMIO(0x7100)
 #define GEN7_SAMPLER_INSTDONE	_MMIO(0xe160)
 #define GEN7_ROW_INSTDONE	_MMIO(0xe164)
+#define GEN8_MCR_SELECTOR		_MMIO(0xfdc)
+#define   GEN8_MCR_SLICE(slice)		(((slice) & 3) << 26)
+#define   GEN8_MCR_SLICE_MASK		GEN8_MCR_SLICE(3)
+#define   GEN8_MCR_SUBSLICE(subslice)	(((subslice) & 3) << 24)
+#define   GEN8_MCR_SUBSLICE_MASK	GEN8_MCR_SUBSLICE(3)
 #define RING_IPEIR(base)	_MMIO((base)+0x64)
 #define RING_IPEHR(base)	_MMIO((base)+0x68)
 /*
drivers/gpu/drm/i915/intel_ringbuffer.h +21 -2
index 4ff4702..66553bd 100644
@@ -73,12 +73,31 @@ enum intel_engine_hangcheck_action {
 
 #define HANGCHECK_SCORE_RING_HUNG 31
 
+#define I915_MAX_SLICES	3
+#define I915_MAX_SUBSLICES 3
+
+#define instdone_slice_mask(dev_priv__) \
+	(INTEL_GEN(dev_priv__) == 7 ? \
+	 1 : INTEL_INFO(dev_priv__)->sseu.slice_mask)
+
+#define instdone_subslice_mask(dev_priv__) \
+	(INTEL_GEN(dev_priv__) == 7 ? \
+	 1 : INTEL_INFO(dev_priv__)->sseu.subslice_mask)
+
+#define for_each_instdone_slice_subslice(dev_priv__, slice__, subslice__) \
+	for ((slice__) = 0, (subslice__) = 0; \
+	     (slice__) < I915_MAX_SLICES; \
+	     (subslice__) = ((subslice__) + 1) < I915_MAX_SUBSLICES ? (subslice__) + 1 : 0, \
+	       (slice__) += ((subslice__) == 0)) \
+		for_each_if((BIT(slice__) & instdone_slice_mask(dev_priv__)) && \
+			    (BIT(subslice__) & instdone_subslice_mask(dev_priv__)))
+
 struct intel_instdone {
 	u32 instdone;
 	/* The following exist only in the RCS engine */
 	u32 slice_common;
-	u32 sampler;
-	u32 row;
+	u32 sampler[I915_MAX_SLICES][I915_MAX_SUBSLICES];
+	u32 row[I915_MAX_SLICES][I915_MAX_SUBSLICES];
 };
 
 struct intel_engine_hangcheck {
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✗ Fi.CI.BAT: warning for series starting with [v2,RESEND,1/2] drm/i915: Cleanup instdone collection

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [v2,RESEND,1/2] drm/i915: Cleanup instdone collection
URL : https://patchwork.freedesktop.org/series/12714/
State : warning

== Summary ==

Series 12714v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/12714/revisions/1/mbox/

Test drv_module_reload_basic:

                pass       -> SKIP       (fi-skl-6770hq)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> SKIP       (fi-hsw-4770r)
Test kms_psr_sink_crc:
        Subgroup psr_basic:
                dmesg-warn -> PASS       (fi-skl-6700hq)
fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
fi-hsw-4770k     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:244  pass:221  dwarn:0   dfail:0   fail:0   skip:23 
fi-ilk-650       total:244  pass:182  dwarn:0   dfail:0   fail:2   skip:60 
fi-ivb-3520m     total:244  pass:219  dwarn:0   dfail:0   fail:0   skip:25 
fi-ivb-3770      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6700k     total:244  pass:219  dwarn:1   dfail:0   fail:0   skip:24 
fi-skl-6770hq    total:244  pass:227  dwarn:1   dfail:0   fail:1   skip:15 
fi-snb-2520m     total:244  pass:208  dwarn:0   dfail:0   fail:0   skip:36 
fi-snb-2600      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_2561/

4ca90e7c3b6e429e033b93fc56fc156da8f222ef drm-intel-nightly: 2016y-09m-20d-12h-43m-32s UTC integration manifest 4721d61 drm/i915: Try to print INSTDONE bits for all slice/subslice
6240439 drm/i915: Cleanup instdone collection

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

author
#3 lore raw

Re: ✗ Fi.CI.BAT: warning for series starting with [v2,RESEND,1/2] drm/i915: Cleanup instdone collection

Quoted 7 lines · Patchwork

== Series Details ==

Series: series starting with [v2,RESEND,1/2] drm/i915: Cleanup instdone collection
URL   : https://patchwork.freedesktop.org/series/12714/
State : warning

Quoted 8 lines

== Summary ==

Series 12714v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/12714/revisions/1/mb
ox/

Test drv_module_reload_basic:
                pass       -> SKIP       (fi-skl-6770hq)

"""
Reloading i915.ko with
unbinding /sys/class/vtconsole/vtcon1/: (M) frame buffer device module successfully unloaded
module successfully loaded again
Reloading i915.ko with inject_load_failure=1 unbinding /sys/class/vtconsole/vtcon1/: (M) frame buffer device
rmmod: ERROR: Module i915 is in use
"""

Pre-existing sporadic issue on multiple platforms, after a successful first module reload.

Quoted 3 lines

Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> SKIP       (fi-hsw-4770r)

"""
hang-read-crc-pipe-A: Testing connector HDMI-A-1 using pipe A Test requirement not met in function test_read_crc, file kms_pipe_crc_basic.c:178:
Test requirement: valid_connectors
No connector found for pipe 0
"""

Pre-existing sporadic issue, HDMI detect fails for an output that was present in earlier subtests.

Thanks for the patches and review, I pushed them to -dinq.

--Imre

Quoted 31 lines

Test kms_psr_sink_crc:
        Subgroup psr_basic:
                dmesg-warn -> PASS       (fi-skl-6700hq)

fi-bdw-
5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 fi-bsw-
n3050     total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 fi-hsw-
4770k     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 fi-hsw-
4770r     total:244  pass:221  dwarn:0   dfail:0   fail:0   skip:23 fi-ilk-
650       total:244  pass:182  dwarn:0   dfail:0   fail:2   skip:60 fi-ivb-
3520m     total:244  pass:219  dwarn:0   dfail:0   fail:0   skip:25 fi-ivb-
3770      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 fi-skl-
6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 fi-skl-
6700hq    total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 fi-skl-
6700k     total:244  pass:219  dwarn:1   dfail:0   fail:0   skip:24 fi-skl-
6770hq    total:244  pass:227  dwarn:1   dfail:0   fail:1   skip:15 fi-snb-
2520m     total:244  pass:208  dwarn:0   dfail:0   fail:0   skip:36 fi-snb-
2600      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37

Quoted 7 lines

Results at /archive/results/CI_IGT_test/Patchwork_2561/

4ca90e7c3b6e429e033b93fc56fc156da8f222ef drm-intel-nightly: 2016y- 09m-20d-12h-43m-32s UTC integration manifest
4721d61 drm/i915: Try to print INSTDONE bits for all slice/subslice 6240439 drm/i915: Cleanup instdone collection

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx