All of lore.kernel.org
 help / color / mirror / Atom feed
* gen3 reset paranoia
@ 2018-02-07 10:08 Chris Wilson
  2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 10:08 UTC (permalink / raw)
  To: intel-gfx

Just a couple of patches lurking in the wings from the last round of
gen3 reset misbehaviour. Not known to improve anything, but maybe?
-Chris

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

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

* [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
@ 2018-02-07 10:08 ` Chris Wilson
  2018-02-07 14:27   ` Mika Kuoppala
  2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 10:08 UTC (permalink / raw)
  To: intel-gfx

Although the mmio are uncached and so should be flushed on every write,
be paranoid and do a mmio read after setting the ring head/tail to be
sure they have taken effect before moving on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 164dbb8cfa36..612aad205b59 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1522,9 +1522,11 @@ static void gen3_stop_engine(struct intel_engine_cs *engine)
 				 engine->name);
 
 	I915_WRITE_FW(RING_HEAD(base), I915_READ_FW(RING_TAIL(base)));
+	POSTING_READ_FW(RING_HEAD(base)); /* paranoia */
 
 	I915_WRITE_FW(RING_HEAD(base), 0);
 	I915_WRITE_FW(RING_TAIL(base), 0);
+	POSTING_READ_FW(RING_HEAD(base));
 
 	/* The ring must be empty before it is disabled */
 	I915_WRITE_FW(RING_CTL(base), 0);
-- 
2.16.1

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

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

* [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
  2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
@ 2018-02-07 10:08 ` Chris Wilson
  2018-02-07 14:41   ` Ville Syrjälä
                     ` (2 more replies)
  2018-02-07 10:38 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings Patchwork
                   ` (6 subsequent siblings)
  8 siblings, 3 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 10:08 UTC (permalink / raw)
  To: intel-gfx

After we assert the reset request (and wait for 20us), when the device
has been fully reset it asserts the reset-status bit. Before we stop
requesting the reset and allow the device to return to normal, we should
wait for the reset to be completed. (Similar to how we wait for the
device to return to normal after deasserting the reset request.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 612aad205b59..dd86428774da 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
 	u8 gdrst;
 
 	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
-	return (gdrst & GRDOM_RESET_STATUS) == 0;
+	return gdrst & GRDOM_RESET_STATUS;
 }
 
 static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
 {
 	struct pci_dev *pdev = dev_priv->drm.pdev;
+	int err;
 
 	/* assert reset for at least 20 usec */
 	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
 	usleep_range(50, 200);
+
+	err = wait_for(i915_reset_complete(pdev), 500);
+
 	pci_write_config_byte(pdev, I915_GDRST, 0);
+	usleep_range(50, 200);
+
+	if (!err)
+		err = wait_for(!i915_reset_complete(pdev), 500);
 
-	return wait_for(i915_reset_complete(pdev), 500);
+	return err;
 }
 
 static bool g4x_reset_complete(struct pci_dev *pdev)
-- 
2.16.1

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

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
  2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
  2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
@ 2018-02-07 10:38 ` Patchwork
  2018-02-07 12:50 ` ✗ Fi.CI.IGT: failure " Patchwork
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-07 10:38 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
URL   : https://patchwork.freedesktop.org/series/37801/
State : success

== Summary ==

Series 37801v1 series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
https://patchwork.freedesktop.org/api/1.0/series/37801/revisions/1/mbox/

Test gem_sync:
        Subgroup basic-all:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-each:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-many-each:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-store-all:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-store-each:
                skip       -> PASS       (fi-pnv-d510)
Test gem_tiled_blits:
        Subgroup basic:
                skip       -> PASS       (fi-pnv-d510)
Test gem_tiled_fence_blits:
        Subgroup basic:
                skip       -> PASS       (fi-pnv-d510)
Test gem_wait:
        Subgroup basic-busy-all:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-wait-all:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-await-all:
                skip       -> PASS       (fi-pnv-d510)
Test kms_busy:
        Subgroup basic-flip-a:
                skip       -> PASS       (fi-pnv-d510)
        Subgroup basic-flip-b:
                skip       -> PASS       (fi-pnv-d510)
Test kms_chamelium:
        Subgroup dp-edid-read:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102505
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                skip       -> PASS       (fi-pnv-d510)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:423s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:492s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:287s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:487s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:588s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:423s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:284s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:512s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:416s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:454s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:417s
fi-kbl-7500u     total:288  pass:262  dwarn:1   dfail:0   fail:1   skip:24  time:457s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:451s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:505s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:591s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:432s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:509s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:526s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:490s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:479s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
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:474s

e5f22cbeec1da222b22367ee3ac165188fb2a36d drm-tip: 2018y-02m-07d-08h-09m-07s UTC integration manifest
5f171cf654e2 drm/i915: Wait for gen3 reset status to be asserted
b3bf384e1dd9 drm/i915: Be paranoid and post the writes to stop the rings

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7918/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (2 preceding siblings ...)
  2018-02-07 10:38 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings Patchwork
@ 2018-02-07 12:50 ` Patchwork
  2018-02-07 22:24 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2) Patchwork
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-07 12:50 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
URL   : https://patchwork.freedesktop.org/series/37801/
State : failure

== Summary ==

Test perf:
        Subgroup oa-exponents:
                pass       -> FAIL       (shard-apl) fdo#102254
        Subgroup enable-disable:
                pass       -> FAIL       (shard-apl) fdo#103715
Test kms_plane_multiple:
        Subgroup atomic-pipe-b-tiling-y:
                fail       -> PASS       (shard-apl) fdo#103166
Test gem_eio:
        Subgroup in-flight:
                pass       -> DMESG-WARN (shard-snb) fdo#104058
                fail       -> PASS       (shard-hsw) fdo#104676 +1
Test kms_flip:
        Subgroup flip-vs-expired-vblank:
                pass       -> FAIL       (shard-apl) fdo#102887
        Subgroup 2x-plain-flip-fb-recreate:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb565-draw-mmap-cpu:
                pass       -> FAIL       (shard-apl)
Test kms_atomic_transition:
        Subgroup 2x-modeset-transitions:
                skip       -> PASS       (shard-hsw)
Test perf_pmu:
        Subgroup frequency:
                pass       -> FAIL       (shard-apl) fdo#104829

fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104829 https://bugs.freedesktop.org/show_bug.cgi?id=104829

shard-apl        total:3409 pass:1758 dwarn:1   dfail:0   fail:25  skip:1624 time:12296s
shard-hsw        total:3442 pass:1757 dwarn:1   dfail:0   fail:12  skip:1671 time:11833s
shard-snb        total:3442 pass:1351 dwarn:2   dfail:0   fail:10  skip:2079 time:6665s
Blacklisted hosts:
shard-kbl        total:3442 pass:1907 dwarn:1   dfail:0   fail:21  skip:1513 time:9738s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7918/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
@ 2018-02-07 14:27   ` Mika Kuoppala
  2018-02-08  7:28     ` [PATCH v2] " Chris Wilson
  0 siblings, 1 reply; 24+ messages in thread
From: Mika Kuoppala @ 2018-02-07 14:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Although the mmio are uncached and so should be flushed on every write,
> be paranoid and do a mmio read after setting the ring head/tail to be
> sure they have taken effect before moving on.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 164dbb8cfa36..612aad205b59 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1522,9 +1522,11 @@ static void gen3_stop_engine(struct intel_engine_cs *engine)
>  				 engine->name);
>  
>  	I915_WRITE_FW(RING_HEAD(base), I915_READ_FW(RING_TAIL(base)));
> +	POSTING_READ_FW(RING_HEAD(base)); /* paranoia */
>  
>  	I915_WRITE_FW(RING_HEAD(base), 0);
>  	I915_WRITE_FW(RING_TAIL(base), 0);
> +	POSTING_READ_FW(RING_HEAD(base));

Is there a benefit on doing it on head? Both
should be flushed but tail would be more eye pleasing.
-Mika

>  
>  	/* The ring must be empty before it is disabled */
>  	I915_WRITE_FW(RING_CTL(base), 0);
> -- 
> 2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
@ 2018-02-07 14:41   ` Ville Syrjälä
  2018-02-07 14:44     ` Ville Syrjälä
  2018-02-07 21:11   ` [PATCH] " Chris Wilson
  2018-02-07 22:28   ` [PATCH v2] " Chris Wilson
  2 siblings, 1 reply; 24+ messages in thread
From: Ville Syrjälä @ 2018-02-07 14:41 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Wed, Feb 07, 2018 at 10:08:45AM +0000, Chris Wilson wrote:
> After we assert the reset request (and wait for 20us), when the device
> has been fully reset it asserts the reset-status bit. Before we stop
> requesting the reset and allow the device to return to normal, we should
> wait for the reset to be completed. (Similar to how we wait for the
> device to return to normal after deasserting the reset request.)
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 612aad205b59..dd86428774da 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
>  	u8 gdrst;
>  
>  	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> -	return (gdrst & GRDOM_RESET_STATUS) == 0;
> +	return gdrst & GRDOM_RESET_STATUS;
>  }
>  
>  static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
>  {
>  	struct pci_dev *pdev = dev_priv->drm.pdev;
> +	int err;
>  
>  	/* assert reset for at least 20 usec */
>  	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
>  	usleep_range(50, 200);
> +
> +	err = wait_for(i915_reset_complete(pdev), 500);

The hardware should indicate that it's in reset as long as we keep the
reset asserted. So this looks like an obfuscated usleep(500) to me.
Did you mean !reset_complete?

> +
>  	pci_write_config_byte(pdev, I915_GDRST, 0);
> +	usleep_range(50, 200);
> +
> +	if (!err)
> +		err = wait_for(!i915_reset_complete(pdev), 500);
>  
> -	return wait_for(i915_reset_complete(pdev), 500);
> +	return err;
>  }
>  
>  static bool g4x_reset_complete(struct pci_dev *pdev)
> -- 
> 2.16.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 14:41   ` Ville Syrjälä
@ 2018-02-07 14:44     ` Ville Syrjälä
  2018-02-07 21:12       ` Chris Wilson
  2018-02-07 22:27       ` Chris Wilson
  0 siblings, 2 replies; 24+ messages in thread
From: Ville Syrjälä @ 2018-02-07 14:44 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Wed, Feb 07, 2018 at 04:41:43PM +0200, Ville Syrjälä wrote:
> On Wed, Feb 07, 2018 at 10:08:45AM +0000, Chris Wilson wrote:
> > After we assert the reset request (and wait for 20us), when the device
> > has been fully reset it asserts the reset-status bit. Before we stop
> > requesting the reset and allow the device to return to normal, we should
> > wait for the reset to be completed. (Similar to how we wait for the
> > device to return to normal after deasserting the reset request.)
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index 612aad205b59..dd86428774da 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
> >  	u8 gdrst;
> >  
> >  	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> > -	return (gdrst & GRDOM_RESET_STATUS) == 0;
> > +	return gdrst & GRDOM_RESET_STATUS;

Doh. Failed to notice this change. The function name is perhaps a bit
confusing now since it doesn't match the meaning of the g4x version.
Maybe rename this guy? i915_gpu_in_reset() or something?

> >  }
> >  
> >  static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
> >  {
> >  	struct pci_dev *pdev = dev_priv->drm.pdev;
> > +	int err;
> >  
> >  	/* assert reset for at least 20 usec */
> >  	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
> >  	usleep_range(50, 200);
> > +
> > +	err = wait_for(i915_reset_complete(pdev), 500);
> 
> The hardware should indicate that it's in reset as long as we keep the
> reset asserted. So this looks like an obfuscated usleep(500) to me.
> Did you mean !reset_complete?
> 
> > +
> >  	pci_write_config_byte(pdev, I915_GDRST, 0);
> > +	usleep_range(50, 200);
> > +
> > +	if (!err)
> > +		err = wait_for(!i915_reset_complete(pdev), 500);
> >  
> > -	return wait_for(i915_reset_complete(pdev), 500);
> > +	return err;
> >  }
> >  
> >  static bool g4x_reset_complete(struct pci_dev *pdev)
> > -- 
> > 2.16.1
> 
> -- 
> Ville Syrjälä
> Intel OTC

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
  2018-02-07 14:41   ` Ville Syrjälä
@ 2018-02-07 21:11   ` Chris Wilson
  2018-02-07 22:28   ` [PATCH v2] " Chris Wilson
  2 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 21:11 UTC (permalink / raw)
  To: intel-gfx

After we assert the reset request (and wait for 20us), when the device
has been fully reset it asserts the reset-status bit. Before we stop
requesting the reset and allow the device to return to normal, we should
wait for the reset to be completed. (Similar to how we wait for the
device to return to normal after deasserting the reset request.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 0fd59dd6bbb5..c46848590873 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1550,24 +1550,40 @@ static void i915_stop_engines(struct drm_i915_private *dev_priv,
 		gen3_stop_engine(engine);
 }
 
-static bool i915_reset_complete(struct pci_dev *pdev)
+static bool i915_reset_asserted(struct pci_dev *pdev)
 {
 	u8 gdrst;
 
 	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
-	return (gdrst & GRDOM_RESET_STATUS) == 0;
+	return gdrst & GRDOM_RESET_STATUS;
 }
 
 static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
 {
 	struct pci_dev *pdev = dev_priv->drm.pdev;
+	ktime_t now;
+	int err;
 
 	/* assert reset for at least 20 usec */
 	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
 	usleep_range(50, 200);
+
+	now = ktime_get_raw();
+	err = wait_for(i915_reset_asserted(pdev), 500);
+	pr_err("wait-for-asserted took %lldns\n",
+	       ktime_to_ns(ktime_sub(ktime_get_raw(), now)));
+
 	pci_write_config_byte(pdev, I915_GDRST, 0);
+	usleep_range(50, 200);
 
-	return wait_for(i915_reset_complete(pdev), 500);
+	if (!err) {
+		now = ktime_get_raw();
+		err = wait_for(!i915_reset_asserted(pdev), 500);
+		pr_err("wait-for-unasserted took %lldns\n",
+		       ktime_to_ns(ktime_sub(ktime_get_raw(), now)));
+	}
+
+	return err;
 }
 
 static bool g4x_reset_complete(struct pci_dev *pdev)
-- 
2.16.1

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

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

* Re: [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 14:44     ` Ville Syrjälä
@ 2018-02-07 21:12       ` Chris Wilson
  2018-02-07 22:27       ` Chris Wilson
  1 sibling, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 21:12 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

Quoting Ville Syrjälä (2018-02-07 14:44:39)
> On Wed, Feb 07, 2018 at 04:41:43PM +0200, Ville Syrjälä wrote:
> > On Wed, Feb 07, 2018 at 10:08:45AM +0000, Chris Wilson wrote:
> > > After we assert the reset request (and wait for 20us), when the device
> > > has been fully reset it asserts the reset-status bit. Before we stop
> > > requesting the reset and allow the device to return to normal, we should
> > > wait for the reset to be completed. (Similar to how we wait for the
> > > device to return to normal after deasserting the reset request.)
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
> > >  1 file changed, 10 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > > index 612aad205b59..dd86428774da 100644
> > > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > > @@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
> > >     u8 gdrst;
> > >  
> > >     pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> > > -   return (gdrst & GRDOM_RESET_STATUS) == 0;
> > > +   return gdrst & GRDOM_RESET_STATUS;
> 
> Doh. Failed to notice this change. The function name is perhaps a bit
> confusing now since it doesn't match the meaning of the g4x version.
> Maybe rename this guy? i915_gpu_in_reset() or something?

i915_reset_asserted() ?
i915_in_reset() I think I like best. _gpu_ feels a little redundant.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2)
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (3 preceding siblings ...)
  2018-02-07 12:50 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-02-07 22:24 ` Patchwork
  2018-02-07 23:46 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3) Patchwork
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-07 22:24 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2)
URL   : https://patchwork.freedesktop.org/series/37801/
State : failure

== Summary ==

Series 37801v2 series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
https://patchwork.freedesktop.org/api/1.0/series/37801/revisions/2/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> INCOMPLETE (fi-bxt-j4205)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-cnl-y3) fdo#104951
        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (fi-bdw-5557u) fdo#104162

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:426s
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:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:492s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:481s
fi-bxt-j4205     total:108  pass:96   dwarn:0   dfail:0   fail:0   skip:11 
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:455s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:567s
fi-cnl-y3        total:288  pass:261  dwarn:1   dfail:0   fail:0   skip:26  time:574s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:297s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:514s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:386s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:414s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:452s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:413s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:458s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:599s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:524s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:484s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:491s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:412s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:428s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:396s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:257  dwarn:0   dfail:0   fail:1   skip:30  time:485s

1e92fee09fd4e434bf016248b72827cd8bd3fd21 drm-tip: 2018y-02m-07d-20h-56m-16s UTC integration manifest
18ea2692a289 drm/i915: Wait for gen3 reset status to be asserted
87d7249f51c6 drm/i915: Be paranoid and post the writes to stop the rings

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7930/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 14:44     ` Ville Syrjälä
  2018-02-07 21:12       ` Chris Wilson
@ 2018-02-07 22:27       ` Chris Wilson
  1 sibling, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 22:27 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

Quoting Ville Syrjälä (2018-02-07 14:44:39)
> On Wed, Feb 07, 2018 at 04:41:43PM +0200, Ville Syrjälä wrote:
> > On Wed, Feb 07, 2018 at 10:08:45AM +0000, Chris Wilson wrote:
> > > After we assert the reset request (and wait for 20us), when the device
> > > has been fully reset it asserts the reset-status bit. Before we stop
> > > requesting the reset and allow the device to return to normal, we should
> > > wait for the reset to be completed. (Similar to how we wait for the
> > > device to return to normal after deasserting the reset request.)
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
> > >  1 file changed, 10 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > > index 612aad205b59..dd86428774da 100644
> > > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > > @@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
> > >     u8 gdrst;
> > >  
> > >     pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> > > -   return (gdrst & GRDOM_RESET_STATUS) == 0;
> > > +   return gdrst & GRDOM_RESET_STATUS;
> 
> Doh. Failed to notice this change. The function name is perhaps a bit
> confusing now since it doesn't match the meaning of the g4x version.
> Maybe rename this guy? i915_gpu_in_reset() or something?

Fwiw,

<3>[  291.416895] wait-for-asserted took 3705ns
<3>[  291.417570] wait-for-unasserted took 3334ns

So it seems like the usleep()s were doing their job.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
  2018-02-07 14:41   ` Ville Syrjälä
  2018-02-07 21:11   ` [PATCH] " Chris Wilson
@ 2018-02-07 22:28   ` Chris Wilson
  2018-02-08 11:43     ` Mika Kuoppala
  2 siblings, 1 reply; 24+ messages in thread
From: Chris Wilson @ 2018-02-07 22:28 UTC (permalink / raw)
  To: intel-gfx

After we assert the reset request (and wait for 20us), when the device
has been fully reset it asserts the reset-status bit. Before we stop
requesting the reset and allow the device to return to normal, we should
wait for the reset to be completed. (Similar to how we wait for the
device to return to normal after deasserting the reset request.)

v2: Rename i915_reset_completed() probe to not cause as much confusion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 0fd59dd6bbb5..e09981a3113c 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1550,24 +1550,31 @@ static void i915_stop_engines(struct drm_i915_private *dev_priv,
 		gen3_stop_engine(engine);
 }
 
-static bool i915_reset_complete(struct pci_dev *pdev)
+static bool i915_in_reset(struct pci_dev *pdev)
 {
 	u8 gdrst;
 
 	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
-	return (gdrst & GRDOM_RESET_STATUS) == 0;
+	return gdrst & GRDOM_RESET_STATUS;
 }
 
 static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
 {
 	struct pci_dev *pdev = dev_priv->drm.pdev;
+	int err;
 
-	/* assert reset for at least 20 usec */
+	/* Assert reset for at least 20 usec, and wait for acknowledgement. */
 	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
 	usleep_range(50, 200);
+	err = wait_for(i915_in_reset(pdev), 500);
+
+	/* Clear the reset request. */
 	pci_write_config_byte(pdev, I915_GDRST, 0);
+	usleep_range(50, 200);
+	if (!err)
+		err = wait_for(!i915_in_reset(pdev), 500);
 
-	return wait_for(i915_reset_complete(pdev), 500);
+	return err;
 }
 
 static bool g4x_reset_complete(struct pci_dev *pdev)
-- 
2.16.1

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

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3)
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (4 preceding siblings ...)
  2018-02-07 22:24 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2) Patchwork
@ 2018-02-07 23:46 ` Patchwork
  2018-02-08  6:30 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-07 23:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3)
URL   : https://patchwork.freedesktop.org/series/37801/
State : success

== Summary ==

Series 37801v3 series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings
https://patchwork.freedesktop.org/api/1.0/series/37801/revisions/3/mbox/

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:423s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:379s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:485s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:287s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
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:467s
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:560s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:578s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:416s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:284s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:509s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:453s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:499s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
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:609s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:508s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:486s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:485s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:414s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:393s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:183  dwarn:1   dfail:4   fail:1   skip:99  time:392s

3a0a17a6152eeae75653d005494cc83f6f2bf47b drm-tip: 2018y-02m-07d-22h-59m-51s UTC integration manifest
5feb804f1d9b drm/i915: Wait for gen3 reset status to be asserted
f5aeb2fd7151 drm/i915: Be paranoid and post the writes to stop the rings

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7932/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3)
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (5 preceding siblings ...)
  2018-02-07 23:46 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3) Patchwork
@ 2018-02-08  6:30 ` Patchwork
  2018-02-08  7:46 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4) Patchwork
  2018-02-08 10:55 ` ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-08  6:30 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3)
URL   : https://patchwork.freedesktop.org/series/37801/
State : success

== Summary ==

Warning: bzip CI_DRM_3739/shard-glkb6/results17.json.bz2 wasn't in correct JSON format
Test kms_sysfs_edid_timing:
                warn       -> PASS       (shard-apl) fdo#100047
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (shard-hsw) fdo#100368
        Subgroup flip-vs-fences:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-dpms-interruptible:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-panning-interruptible:
                skip       -> PASS       (shard-apl)
        Subgroup nonexisting-fb:
                skip       -> PASS       (shard-apl)
        Subgroup blocking-absolute-wf_vblank-interruptible:
                skip       -> PASS       (shard-apl)
Test pm_rpm:
        Subgroup legacy-planes-dpms:
                skip       -> PASS       (shard-apl)
        Subgroup modeset-non-lpsp-stress:
                skip       -> PASS       (shard-apl)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-cursor-busy-crc-atomic:
                skip       -> PASS       (shard-apl)
        Subgroup cursora-vs-flipa-toggle:
                skip       -> PASS       (shard-apl)
Test gem_mmap_wc:
        Subgroup set-cache-level:
                skip       -> PASS       (shard-apl)
Test kms_chv_cursor_fail:
        Subgroup pipe-a-64x64-top-edge:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-64x64-bottom-edge:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-64x64-top-edge:
                skip       -> PASS       (shard-apl)
Test kms_plane_lowres:
        Subgroup pipe-b-tiling-yf:
                skip       -> PASS       (shard-apl) fdo#103166 +1
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-cur-indfb-draw-blt:
                skip       -> PASS       (shard-apl) fdo#103167 +2
        Subgroup fbc-indfb-scaledprimary:
                skip       -> PASS       (shard-apl)
        Subgroup fbc-1p-primscrn-pri-indfb-draw-render:
                skip       -> PASS       (shard-apl) fdo#101623 +1
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
                skip       -> PASS       (shard-apl)
Test kms_fbcon_fbt:
        Subgroup fbc:
                skip       -> PASS       (shard-apl)
Test kms_atomic:
        Subgroup test_only:
                skip       -> PASS       (shard-apl)
        Subgroup plane_overlay_legacy:
                skip       -> PASS       (shard-apl)
Test kms_vblank:
        Subgroup pipe-b-wait-idle:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-wait-forked-busy:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-ts-continuation-idle-hang:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-wait-busy:
                skip       -> PASS       (shard-apl)
Test kms_color:
        Subgroup pipe-a-ctm-blue-to-red:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-legacy-gamma-reset:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-ctm-0-25:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-ctm-0-75:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-ctm-blue-to-red:
                skip       -> PASS       (shard-apl)
Test kms_busy:
        Subgroup extended-modeset-hang-oldfb-with-reset-render-b:
                skip       -> PASS       (shard-apl)
Test kms_cursor_crc:
        Subgroup cursor-256x85-sliding:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-64x21-offscreen:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-256x256-onscreen:
                skip       -> PASS       (shard-apl)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                skip       -> PASS       (shard-apl) fdo#103481
        Subgroup nonblocking-crc-pipe-b:
                skip       -> PASS       (shard-apl)
Test kms_ccs:
        Subgroup pipe-b-bad-pixel-format:
                skip       -> PASS       (shard-apl)
Test kms_draw_crc:
        Subgroup draw-method-xrgb8888-mmap-gtt-xtiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb8888-render-xtiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-rgb565-pwrite-untiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb2101010-pwrite-untiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb2101010-render-xtiled:
                skip       -> PASS       (shard-apl)
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-c-planes:
                dmesg-warn -> PASS       (shard-apl) fdo#104164
Test kms_rmfb:
        Subgroup close-fd:
                skip       -> PASS       (shard-apl)

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#104164 https://bugs.freedesktop.org/show_bug.cgi?id=104164

shard-apl        total:3413 pass:1768 dwarn:1   dfail:0   fail:20  skip:1623 time:12483s
shard-hsw        total:3444 pass:1761 dwarn:1   dfail:0   fail:10  skip:1671 time:11802s
shard-snb        total:3444 pass:1351 dwarn:1   dfail:0   fail:10  skip:2082 time:6614s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7932/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-07 14:27   ` Mika Kuoppala
@ 2018-02-08  7:28     ` Chris Wilson
  2018-02-08 11:39       ` Mika Kuoppala
  0 siblings, 1 reply; 24+ messages in thread
From: Chris Wilson @ 2018-02-08  7:28 UTC (permalink / raw)
  To: intel-gfx

Although the mmio are uncached and so should be flushed on every write,
be paranoid and do a mmio read after setting the ring head/tail to be
sure they have taken effect before moving on.

v2: post tail to be pleasing to the eye

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 164dbb8cfa36..0fd59dd6bbb5 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1522,9 +1522,11 @@ static void gen3_stop_engine(struct intel_engine_cs *engine)
 				 engine->name);
 
 	I915_WRITE_FW(RING_HEAD(base), I915_READ_FW(RING_TAIL(base)));
+	POSTING_READ_FW(RING_HEAD(base)); /* paranoia */
 
 	I915_WRITE_FW(RING_HEAD(base), 0);
 	I915_WRITE_FW(RING_TAIL(base), 0);
+	POSTING_READ_FW(RING_TAIL(base));
 
 	/* The ring must be empty before it is disabled */
 	I915_WRITE_FW(RING_CTL(base), 0);
-- 
2.16.1

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

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

* ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4)
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (6 preceding siblings ...)
  2018-02-08  6:30 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-02-08  7:46 ` Patchwork
  2018-02-08 10:55 ` ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-08  7:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4)
URL   : https://patchwork.freedesktop.org/series/37801/
State : success

== Summary ==

Series 37801v4 series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings
https://patchwork.freedesktop.org/api/1.0/series/37801/revisions/4/mbox/

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:488s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:287s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:468s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:457s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:567s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:574s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:416s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:283s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
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:458s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:461s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:500s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
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:601s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
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:487s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:479s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:412s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:523s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:396s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:466s

3a0a17a6152eeae75653d005494cc83f6f2bf47b drm-tip: 2018y-02m-07d-22h-59m-51s UTC integration manifest
9b16d3a7a98b drm/i915: Wait for gen3 reset status to be asserted
e7e10f1f6bab drm/i915: Be paranoid and post the writes to stop the rings

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7936/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: failure for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4)
  2018-02-07 10:08 gen3 reset paranoia Chris Wilson
                   ` (7 preceding siblings ...)
  2018-02-08  7:46 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4) Patchwork
@ 2018-02-08 10:55 ` Patchwork
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2018-02-08 10:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4)
URL   : https://patchwork.freedesktop.org/series/37801/
State : failure

== Summary ==

Warning: bzip CI_DRM_3739/shard-glkb6/results17.json.bz2 wasn't in correct JSON format
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (shard-hsw) fdo#100368
        Subgroup blocking-absolute-wf_vblank-interruptible:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-fences:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-dpms-interruptible:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-panning-interruptible:
                skip       -> PASS       (shard-apl)
        Subgroup nonexisting-fb:
                skip       -> PASS       (shard-apl)
Test kms_vblank:
        Subgroup pipe-b-ts-continuation-suspend:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-b-wait-idle:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-wait-forked-busy:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-ts-continuation-idle-hang:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-wait-busy:
                skip       -> PASS       (shard-apl)
Test kms_cursor_crc:
        Subgroup cursor-64x21-offscreen:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-256x256-onscreen:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-256x85-sliding:
                skip       -> PASS       (shard-apl)
        Subgroup cursor-128x128-suspend:
                pass       -> INCOMPLETE (shard-hsw) fdo#103540
Test kms_draw_crc:
        Subgroup draw-method-xrgb8888-mmap-gtt-xtiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb8888-render-xtiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-rgb565-pwrite-untiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb2101010-pwrite-untiled:
                skip       -> PASS       (shard-apl)
        Subgroup draw-method-xrgb2101010-render-xtiled:
                skip       -> PASS       (shard-apl)
Test kms_cursor_legacy:
        Subgroup cursora-vs-flipa-toggle:
                skip       -> PASS       (shard-apl)
        Subgroup basic-busy-flip-before-cursor-atomic:
                skip       -> PASS       (shard-apl)
        Subgroup flip-vs-cursor-busy-crc-atomic:
                skip       -> PASS       (shard-apl)
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-c-planes:
                dmesg-warn -> PASS       (shard-apl) fdo#104164
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b:
                skip       -> PASS       (shard-apl)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                skip       -> PASS       (shard-apl) fdo#103481
Test kms_chv_cursor_fail:
        Subgroup pipe-c-64x64-top-edge:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-64x64-top-edge:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-64x64-bottom-edge:
                skip       -> PASS       (shard-apl)
Test kms_rmfb:
        Subgroup close-fd:
                skip       -> PASS       (shard-apl)
Test kms_color:
        Subgroup pipe-c-ctm-blue-to-red:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-ctm-blue-to-red:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-b-legacy-gamma-reset:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-a-ctm-0-25:
                skip       -> PASS       (shard-apl)
        Subgroup pipe-c-ctm-0-75:
                skip       -> PASS       (shard-apl)
Test pm_rpm:
        Subgroup legacy-planes-dpms:
                skip       -> PASS       (shard-apl)
        Subgroup modeset-non-lpsp-stress:
                skip       -> PASS       (shard-apl)
Test gem_mmap_wc:
        Subgroup set-cache-level:
                skip       -> PASS       (shard-apl)
Test kms_plane_lowres:
        Subgroup pipe-b-tiling-yf:
                skip       -> PASS       (shard-apl) fdo#103166 +1
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-cur-indfb-draw-blt:
                skip       -> PASS       (shard-apl) fdo#103167 +2
        Subgroup fbc-indfb-scaledprimary:
                skip       -> PASS       (shard-apl)
        Subgroup fbc-1p-primscrn-pri-indfb-draw-render:
                skip       -> PASS       (shard-apl) fdo#101623 +1
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
                skip       -> PASS       (shard-apl)
Test kms_fbcon_fbt:
        Subgroup fbc:
                skip       -> PASS       (shard-apl)
Test kms_atomic:
        Subgroup test_only:
                skip       -> PASS       (shard-apl)
        Subgroup plane_overlay_legacy:
                skip       -> PASS       (shard-apl)
Test kms_busy:
        Subgroup extended-modeset-hang-oldfb-with-reset-render-b:
                skip       -> PASS       (shard-apl)
Test kms_ccs:
        Subgroup pipe-b-bad-pixel-format:
                skip       -> PASS       (shard-apl)
Test perf:
        Subgroup oa-exponents:
                fail       -> PASS       (shard-apl) fdo#102254

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#104164 https://bugs.freedesktop.org/show_bug.cgi?id=104164
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254

shard-apl        total:3413 pass:1768 dwarn:1   dfail:0   fail:19  skip:1623 time:12494s
shard-hsw        total:3356 pass:1711 dwarn:1   dfail:0   fail:10  skip:1631 time:10966s
shard-snb        total:3444 pass:1351 dwarn:1   dfail:0   fail:10  skip:2082 time:6653s
Blacklisted hosts:
shard-kbl        total:3444 pass:1910 dwarn:1   dfail:0   fail:21  skip:1512 time:9673s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7936/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Be paranoid and post the writes to stop the rings
  2018-02-08  7:28     ` [PATCH v2] " Chris Wilson
@ 2018-02-08 11:39       ` Mika Kuoppala
  0 siblings, 0 replies; 24+ messages in thread
From: Mika Kuoppala @ 2018-02-08 11:39 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Although the mmio are uncached and so should be flushed on every write,
> be paranoid and do a mmio read after setting the ring head/tail to be
> sure they have taken effect before moving on.
>
> v2: post tail to be pleasing to the eye
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

This amount paranoia is warranted and clearly noted so,

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 164dbb8cfa36..0fd59dd6bbb5 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1522,9 +1522,11 @@ static void gen3_stop_engine(struct intel_engine_cs *engine)
>  				 engine->name);
>  
>  	I915_WRITE_FW(RING_HEAD(base), I915_READ_FW(RING_TAIL(base)));
> +	POSTING_READ_FW(RING_HEAD(base)); /* paranoia */
>  
>  	I915_WRITE_FW(RING_HEAD(base), 0);
>  	I915_WRITE_FW(RING_TAIL(base), 0);
> +	POSTING_READ_FW(RING_TAIL(base));
>  
>  	/* The ring must be empty before it is disabled */
>  	I915_WRITE_FW(RING_CTL(base), 0);
> -- 
> 2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-07 22:28   ` [PATCH v2] " Chris Wilson
@ 2018-02-08 11:43     ` Mika Kuoppala
  2018-02-08 11:55       ` Chris Wilson
  2018-02-08 13:46       ` Chris Wilson
  0 siblings, 2 replies; 24+ messages in thread
From: Mika Kuoppala @ 2018-02-08 11:43 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> After we assert the reset request (and wait for 20us), when the device
> has been fully reset it asserts the reset-status bit. Before we stop
> requesting the reset and allow the device to return to normal, we should
> wait for the reset to be completed. (Similar to how we wait for the
> device to return to normal after deasserting the reset request.)
>
> v2: Rename i915_reset_completed() probe to not cause as much confusion.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 0fd59dd6bbb5..e09981a3113c 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1550,24 +1550,31 @@ static void i915_stop_engines(struct drm_i915_private *dev_priv,
>  		gen3_stop_engine(engine);
>  }
>  
> -static bool i915_reset_complete(struct pci_dev *pdev)
> +static bool i915_in_reset(struct pci_dev *pdev)
>  {
>  	u8 gdrst;
>  
>  	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> -	return (gdrst & GRDOM_RESET_STATUS) == 0;
> +	return gdrst & GRDOM_RESET_STATUS;
>  }
>  
>  static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
>  {
>  	struct pci_dev *pdev = dev_priv->drm.pdev;
> +	int err;
>  
> -	/* assert reset for at least 20 usec */
> +	/* Assert reset for at least 20 usec, and wait for acknowledgement. */
>  	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
>  	usleep_range(50, 200);
> +	err = wait_for(i915_in_reset(pdev), 500);
> +
> +	/* Clear the reset request. */
>  	pci_write_config_byte(pdev, I915_GDRST, 0);
> +	usleep_range(50, 200);
> +	if (!err)
> +		err = wait_for(!i915_in_reset(pdev), 500);
>

Regardless of if this helps or not with pnv, it makes the
both phases clear.

Any thoughts of starting to log the reset attempts
with timeout, even if the subsequent reset succeeds?

Patch is,
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> -	return wait_for(i915_reset_complete(pdev), 500);
> +	return err;
>  }
>  
>  static bool g4x_reset_complete(struct pci_dev *pdev)
> -- 
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-08 11:43     ` Mika Kuoppala
@ 2018-02-08 11:55       ` Chris Wilson
  2018-02-08 12:34         ` Mika Kuoppala
  2018-02-08 13:46       ` Chris Wilson
  1 sibling, 1 reply; 24+ messages in thread
From: Chris Wilson @ 2018-02-08 11:55 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-02-08 11:43:50)
> Any thoughts of starting to log the reset attempts
> with timeout, even if the subsequent reset succeeds?

If it succeeds, do we care? Capturing why it fails, sure.

The question being what do we want to gain from it? Faster reset by
removing timeout loops -- but if it does take X attempts, we can't
really make it faster, just swap out one delay for another?

It's a challenge, trying to provide the right information to solve a
user's problem without their intervention and without any burden.
Easier when you are chasing a problem down to know what you need. And
likely need again in future?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-08 11:55       ` Chris Wilson
@ 2018-02-08 12:34         ` Mika Kuoppala
  2018-02-08 13:45           ` Chris Wilson
  0 siblings, 1 reply; 24+ messages in thread
From: Mika Kuoppala @ 2018-02-08 12:34 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Mika Kuoppala (2018-02-08 11:43:50)
>> Any thoughts of starting to log the reset attempts
>> with timeout, even if the subsequent reset succeeds?
>
> If it succeeds, do we care? Capturing why it fails, sure.
>
> The question being what do we want to gain from it? Faster reset by
> removing timeout loops -- but if it does take X attempts, we can't
> really make it faster, just swap out one delay for another?
>
> It's a challenge, trying to provide the right information to solve a
> user's problem without their intervention and without any burden.
> Easier when you are chasing a problem down to know what you need. And
> likely need again in future?

I was thinking of gauging the rest robustness. To check if
the level we are at, through CI. I would keep the timeouts and would
keep retries. 

Mainly the intent would be to find a pattern. Like if on some platform,
after test x, the first reset always timeouts would be a sign
to further robustify.

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

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

* Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-08 12:34         ` Mika Kuoppala
@ 2018-02-08 13:45           ` Chris Wilson
  0 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-08 13:45 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-02-08 12:34:08)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Quoting Mika Kuoppala (2018-02-08 11:43:50)
> >> Any thoughts of starting to log the reset attempts
> >> with timeout, even if the subsequent reset succeeds?
> >
> > If it succeeds, do we care? Capturing why it fails, sure.
> >
> > The question being what do we want to gain from it? Faster reset by
> > removing timeout loops -- but if it does take X attempts, we can't
> > really make it faster, just swap out one delay for another?
> >
> > It's a challenge, trying to provide the right information to solve a
> > user's problem without their intervention and without any burden.
> > Easier when you are chasing a problem down to know what you need. And
> > likely need again in future?
> 
> I was thinking of gauging the rest robustness. To check if
> the level we are at, through CI. I would keep the timeouts and would
> keep retries. 
> 
> Mainly the intent would be to find a pattern. Like if on some platform,
> after test x, the first reset always timeouts would be a sign
> to further robustify.

But unless you automate such pattern finding, it will be lost and just
annoy the next person trying to extract signal from the noise :)

If you can think of it, write a test for it and let it run for a few
months in CI.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
  2018-02-08 11:43     ` Mika Kuoppala
  2018-02-08 11:55       ` Chris Wilson
@ 2018-02-08 13:46       ` Chris Wilson
  1 sibling, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2018-02-08 13:46 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-02-08 11:43:50)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > After we assert the reset request (and wait for 20us), when the device
> > has been fully reset it asserts the reset-status bit. Before we stop
> > requesting the reset and allow the device to return to normal, we should
> > wait for the reset to be completed. (Similar to how we wait for the
> > device to return to normal after deasserting the reset request.)
> >
> > v2: Rename i915_reset_completed() probe to not cause as much confusion.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_uncore.c | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index 0fd59dd6bbb5..e09981a3113c 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -1550,24 +1550,31 @@ static void i915_stop_engines(struct drm_i915_private *dev_priv,
> >               gen3_stop_engine(engine);
> >  }
> >  
> > -static bool i915_reset_complete(struct pci_dev *pdev)
> > +static bool i915_in_reset(struct pci_dev *pdev)
> >  {
> >       u8 gdrst;
> >  
> >       pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> > -     return (gdrst & GRDOM_RESET_STATUS) == 0;
> > +     return gdrst & GRDOM_RESET_STATUS;
> >  }
> >  
> >  static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
> >  {
> >       struct pci_dev *pdev = dev_priv->drm.pdev;
> > +     int err;
> >  
> > -     /* assert reset for at least 20 usec */
> > +     /* Assert reset for at least 20 usec, and wait for acknowledgement. */
> >       pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
> >       usleep_range(50, 200);
> > +     err = wait_for(i915_in_reset(pdev), 500);
> > +
> > +     /* Clear the reset request. */
> >       pci_write_config_byte(pdev, I915_GDRST, 0);
> > +     usleep_range(50, 200);
> > +     if (!err)
> > +             err = wait_for(!i915_in_reset(pdev), 500);
> >
> 
> Regardless of if this helps or not with pnv, it makes the
> both phases clear.
> 
> Any thoughts of starting to log the reset attempts
> with timeout, even if the subsequent reset succeeds?
> 
> Patch is,
> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Although I don't expect this pair to help CI, it feels justifiable
paranoia. Thanks for the review,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-02-08 13:46 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 10:08 gen3 reset paranoia Chris Wilson
2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
2018-02-07 14:27   ` Mika Kuoppala
2018-02-08  7:28     ` [PATCH v2] " Chris Wilson
2018-02-08 11:39       ` Mika Kuoppala
2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
2018-02-07 14:41   ` Ville Syrjälä
2018-02-07 14:44     ` Ville Syrjälä
2018-02-07 21:12       ` Chris Wilson
2018-02-07 22:27       ` Chris Wilson
2018-02-07 21:11   ` [PATCH] " Chris Wilson
2018-02-07 22:28   ` [PATCH v2] " Chris Wilson
2018-02-08 11:43     ` Mika Kuoppala
2018-02-08 11:55       ` Chris Wilson
2018-02-08 12:34         ` Mika Kuoppala
2018-02-08 13:45           ` Chris Wilson
2018-02-08 13:46       ` Chris Wilson
2018-02-07 10:38 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings Patchwork
2018-02-07 12:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-02-07 22:24 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2) Patchwork
2018-02-07 23:46 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3) Patchwork
2018-02-08  6:30 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-08  7:46 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4) Patchwork
2018-02-08 10:55 ` ✗ Fi.CI.IGT: failure " 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.