Skip to contentSkip to conversation

drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

PATCH In review Chris Wilson 3 participants 6 messages Feb 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

Be paranoid and flush the GTIIR after clearing the CS interrupt to be sure it has taken before we re-enable the interrupt handler. We still see early interrupts following reset, the tasklet handling the mmio read before it has been written by the CS. This hopefully reduces the frequency to 0...

References: https://bugs.freedesktop.org/show_bug.cgi?id=104262

Cc Mika Kuoppala <[email protected]>
Cc Michel Thierry <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +9 -4
index 40dbeaee9dfa..deeedfc9fe44 100644
@@ -1527,6 +1527,7 @@ static int gen9_init_render_ring(struct intel_engine_cs *engine)
 static void reset_irq(struct intel_engine_cs *engine)
 {
 	struct drm_i915_private *dev_priv = engine->i915;
+	int i;
 
 	/*
 	 * Clear any pending interrupt state.
@@ -1535,10 +1536,14 @@ static void reset_irq(struct intel_engine_cs *engine)
 	 * buffered, and if we only reset it once there may still be
 	 * an interrupt pending.
 	 */
-	I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-		   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
-	I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-		   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+	for (i = 0; i < 2; i++) {
+		I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
+			   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+		POSTING_READ(GEN8_GT_IIR(gtiir[engine->id]));
+	}
+	GEM_BUG_ON(I915_READ(GEN8_GT_IIR(gtiir[engine->id])) &
+		   (GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift));
+
 	clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
 }
 
Signature · 6 lines
2.15.1

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

✓ Fi.CI.BAT: success for drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

== Series Details ==

== Series Details ==

Series: drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset
URL : https://patchwork.freedesktop.org/series/37552/
State : success

== Summary ==

Series 37552v1 drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset
https://patchwork.freedesktop.org/api/1.0/series/37552/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                incomplete -> PASS       (fi-bdw-5557u) fdo#104162
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-c:
                pass       -> FAIL       (fi-skl-guc) fdo#103191

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104162 https://bugs.freedesktop.org/show_bug.cgi?id=104162
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:415s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:422s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:370s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:483s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:483s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:466s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:452s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:412s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:506s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:388s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:400s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:411s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:445s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:417s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:456s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:494s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:574s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:425s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-skl-guc       total:288  pass:259  dwarn:0   dfail:0   fail:1   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:428s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:525s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:399s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:468s

bde4e003ce549b8225142843e0d5aee19dd37d13 drm-tip: 2018y-02m-02d-15h-03m-15s UTC integration manifest 8f0272654e6b drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7863/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on v1 1/1
#2 lore raw
In reply to Chris Wilson
Quoted 37 lines · Chris Wilson

Be paranoid and flush the GTIIR after clearing the CS interrupt to be sure it has taken before we re-enable the interrupt handler. We still see early interrupts following reset, the tasklet handling the mmio read before it has been written by the CS. This hopefully reduces the frequency to 0...

References: https://bugs.freedesktop.org/show_bug.cgi?id=104262

Cc Mika Kuoppala <[email protected]>
Cc Michel Thierry <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
  drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +2 -4
index 40dbeaee9dfa..deeedfc9fe44 100644
@@ -1527,6 +1527,7 @@ static int gen9_init_render_ring(struct intel_engine_cs *engine)
  static void reset_irq(struct intel_engine_cs *engine)
  {
  	struct drm_i915_private *dev_priv = engine->i915;
+	int i;
 
  	/*
  	 * Clear any pending interrupt state.
@@ -1535,10 +1536,14 @@ static void reset_irq(struct intel_engine_cs *engine)
  	 * buffered, and if we only reset it once there may still be
  	 * an interrupt pending.
  	 */
-	I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-		   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
-	I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-		   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+	for (i = 0; i < 2; i++) {

drivers/gpu/drm/i915/intel_lrc.c static void reset_irq(struct intel_engine_cs *engine) · line 1549

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +7 -0
+		I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
+			   GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+		POSTING_READ(GEN8_GT_IIR(gtiir[engine->id]));
+	}
+	GEM_BUG_ON(I915_READ(GEN8_GT_IIR(gtiir[engine->id])) &
+		   (GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift));
+
  	clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
  }
 

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

#3 lore raw

Quoting Michel Thierry (2018-02-02 16:49:49)

Quoted 42 lines · Chris Wilson
Quoted 41 lines

Be paranoid and flush the GTIIR after clearing the CS interrupt to be sure it has taken before we re-enable the interrupt handler. We still see early interrupts following reset, the tasklet handling the mmio read before it has been written by the CS. This hopefully reduces the frequency to 0...

References: https://bugs.freedesktop.org/show_bug.cgi?id=104262

Cc Mika Kuoppala <[email protected]>
Cc Michel Thierry <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
  drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +7 -4
index 40dbeaee9dfa..deeedfc9fe44 100644
@@ -1527,6 +1527,7 @@ static int gen9_init_render_ring(struct intel_engine_cs *engine)
  static void reset_irq(struct intel_engine_cs *engine)
  {
      struct drm_i915_private *dev_priv = engine->i915;
+     int i;
 
      /*
       * Clear any pending interrupt state.
@@ -1535,10 +1536,14 @@ static void reset_irq(struct intel_engine_cs *engine)
       * buffered, and if we only reset it once there may still be
       * an interrupt pending.
       */
-     I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-                GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
-     I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
-                GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+     for (i = 0; i < 2; i++) {
+             I915_WRITE(GEN8_GT_IIR(gtiir[engine->id]),
+                        GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift);
+             POSTING_READ(GEN8_GT_IIR(gtiir[engine->id]));
+     }
+     GEM_BUG_ON(I915_READ(GEN8_GT_IIR(gtiir[engine->id])) &
Quoted 8 lines

drivers/gpu/drm/i915/intel_lrc.c static void reset_irq(struct intel_engine_cs *engine) · line 1549

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +2 -0
+                (GT_CONTEXT_SWITCH_INTERRUPT << engine->irq_shift));
+
      clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
  }
 

Ta. Afaict, it's a timing issue and this is helping paper over it. Not a fix, but maybe an indicator for someone to find the real problem? -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset
URL : https://patchwork.freedesktop.org/series/37552/
State : success

== Summary ==

Test perf:

        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715
Test perf_pmu:
        Subgroup busy-double-start-vcs0:
                incomplete -> PASS       (shard-apl)
Test kms_flip:
        Subgroup 2x-plain-flip-ts-check:
                fail       -> PASS       (shard-hsw)
        Subgroup plain-flip-ts-check:
                fail       -> PASS       (shard-hsw) fdo#100368

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

shard-apl        total:2836 pass:1751 dwarn:1   dfail:0   fail:20  skip:1064 time:12305s
shard-hsw        total:2800 pass:1710 dwarn:1   dfail:0   fail:11  skip:1076 time:10834s
shard-snb        total:2836 pass:1328 dwarn:1   dfail:0   fail:10  skip:1497 time:6378s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7863/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: ✓ Fi.CI.IGT: success for drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset

Quoting Patchwork (2018-02-02 20:25:31)

Quoted 22 lines

== Series Details ==

Series: drm/i915/execlists: Flush GTIIR on clearing CS interrupts during reset
URL : https://patchwork.freedesktop.org/series/37552/
State : success

== Summary ==

Test perf:

        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715
Test perf_pmu:
        Subgroup busy-double-start-vcs0:
                incomplete -> PASS       (shard-apl)
Test kms_flip:
        Subgroup 2x-plain-flip-ts-check:
                fail       -> PASS       (shard-hsw)
        Subgroup plain-flip-ts-check:
                fail       -> PASS       (shard-hsw) fdo#100368
Quoted 7 lines

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

shard-apl        total:2836 pass:1751 dwarn:1   dfail:0   fail:20  skip:1064 time:12305s
shard-hsw        total:2800 pass:1710 dwarn:1   dfail:0   fail:11  skip:1076 time:10834s
shard-snb        total:2836 pass:1328 dwarn:1   dfail:0   fail:10  skip:1497 time:6378s

As thankfully it doesn't appear to upset the shards, and it should just be a bit of paranoia fluff that just happens to make my bxt that little bit more stable, I've pushed it. If only to have that GEM_BUG_ON() that the GTIIR isn't set at reset_irq()!

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