All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Sleep after restarting the GPU after reset
@ 2017-04-02 14:36 Chris Wilson
  2017-04-02 14:53 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-04-02 16:06 ` [PATCH] " Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2017-04-02 14:36 UTC (permalink / raw)
  To: intel-gfx

A piece of magic that prevents Baytrail from doing a timewarp. (Perhaps
executing an incorrect portion of the ring?) If left to itself after a
few hundred resets, the GPU will write a stale seqno causing all
requests to be completed early and the GPU then appears idle.

A msleep(1000) before the intel_gpu_reset, or after it is not
sufficient, but a short delay of a few hundred microseconds after
writing the RING_CTL is. Less than a few hundred us, or inserting a few
more posting reads into the init_ring_common is not enough. To limit the
impact, it appears we only need one after all RING_CTL writes and also we
only want to apply it when writing nonzero values into the RING_HEAD/TAIL
i.e. after reset.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98836
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index bbc6f1c9f175..54e6d8b43c2b 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4581,6 +4581,9 @@ static int __i915_gem_restart_engines(void *data)
 			return err;
 	}
 
+	/* Small piece of magic to stablize resets of an active GPU */
+	msleep(1);
+
 	return 0;
 }
 
-- 
2.11.0

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Sleep after restarting the GPU after reset
  2017-04-02 14:36 [PATCH] drm/i915: Sleep after restarting the GPU after reset Chris Wilson
@ 2017-04-02 14:53 ` Patchwork
  2017-04-02 16:06 ` [PATCH] " Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-04-02 14:53 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Sleep after restarting the GPU after reset
URL   : https://patchwork.freedesktop.org/series/22329/
State : success

== Summary ==

Series 22329v1 drm/i915: Sleep after restarting the GPU after reset
https://patchwork.freedesktop.org/api/1.0/series/22329/revisions/1/mbox/

Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-kbl-7560u) fdo#100125

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

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 427s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time: 430s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 570s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 507s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 555s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 484s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 483s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 408s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 407s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 416s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 491s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 467s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 451s
fi-kbl-7560u     total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10  time: 569s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 458s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 568s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 455s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 486s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time: 437s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 529s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time: 402s

19ceec7d516a7c4614833ba7a3724a4bea0c59d3 drm-tip: 2017y-03m-31d-20h-10m-03s UTC integration manifest
2aab31f drm/i915: Sleep after restarting the GPU after reset

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4380/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Sleep after restarting the GPU after reset
  2017-04-02 14:36 [PATCH] drm/i915: Sleep after restarting the GPU after reset Chris Wilson
  2017-04-02 14:53 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-04-02 16:06 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2017-04-02 16:06 UTC (permalink / raw)
  To: intel-gfx

On Sun, Apr 02, 2017 at 03:36:11PM +0100, Chris Wilson wrote:
> A piece of magic that prevents Baytrail from doing a timewarp. (Perhaps
> executing an incorrect portion of the ring?) If left to itself after a
> few hundred resets, the GPU will write a stale seqno causing all
> requests to be completed early and the GPU then appears idle.

+ stuck in the future

> A msleep(1000) before the intel_gpu_reset, or after it is not
> sufficient, but a short delay of a few hundred microseconds after

(also demonstrating that this is not a stray write left inflight from
before the reset)

> writing the RING_CTL is. Less than a few hundred us, or inserting a few
> more posting reads into the init_ring_common is not enough. To limit the
> impact, it appears we only need one after all RING_CTL writes and also we
> only want to apply it when writing nonzero values into the RING_HEAD/TAIL
> i.e. after reset.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98836
Testcase: igt/gem_exec_whisper/hang-chain
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Before I forget to add them.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-04-02 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-02 14:36 [PATCH] drm/i915: Sleep after restarting the GPU after reset Chris Wilson
2017-04-02 14:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-02 16:06 ` [PATCH] " Chris Wilson

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.