All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Always sanity check engine state upon idling
@ 2017-08-26 11:09 Chris Wilson
  2017-08-26 11:09 ` [PATCH 2/3] drm/i915: Clear wedged status upon resume Chris Wilson
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Chris Wilson @ 2017-08-26 11:09 UTC (permalink / raw)
  To: intel-gfx; +Cc: Matthias Kaehlcke

When we do a locked idle we know that afterwards all requests have been
completed and the engines have been cleared of tasks. For whatever
reason, this doesn't always happen and we may go into a suspend with
ELSP still full, and this causes an issue upon resume as we get very,
very confused.

If the engines refuse to idle, mark the device as wedged. In the process
we get rid of the maybe unused open-coded version of wait_for_engines
reported by Nick Desaulniers and Matthias Kaehlcke.

References: https://bugs.freedesktop.org/show_bug.cgi?id=101891
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>
Cc: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/gpu/drm/i915/i915_gem.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ac02785fdaff..c1520c0d2084 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3371,24 +3371,12 @@ static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags)
 	return 0;
 }
 
-static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)
-{
-	return wait_for(intel_engine_is_idle(engine), timeout_ms);
-}
-
 static int wait_for_engines(struct drm_i915_private *i915)
 {
-	struct intel_engine_cs *engine;
-	enum intel_engine_id id;
-
-	for_each_engine(engine, i915, id) {
-		if (GEM_WARN_ON(wait_for_engine(engine, 50))) {
-			i915_gem_set_wedged(i915);
-			return -EIO;
-		}
-
-		GEM_BUG_ON(intel_engine_get_seqno(engine) !=
-			   intel_engine_last_submit(engine));
+	if (wait_for(intel_engines_are_idle(i915), 50)) {
+		DRM_ERROR("Failed to idle engines, declaring wedged!\n");
+		i915_gem_set_wedged(i915);
+		return -EIO;
 	}
 
 	return 0;
-- 
2.14.1

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

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

end of thread, other threads:[~2017-08-29 13:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-26 11:09 [PATCH 1/3] drm/i915: Always sanity check engine state upon idling Chris Wilson
2017-08-26 11:09 ` [PATCH 2/3] drm/i915: Clear wedged status upon resume Chris Wilson
2017-08-29 13:49   ` Mika Kuoppala
2017-08-26 11:09 ` [PATCH 3/3] drm/i915: Discard the request queue if we fail to sleep before suspend Chris Wilson
2017-08-29 13:54   ` Mika Kuoppala
2017-08-26 11:26 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Always sanity check engine state upon idling Patchwork
2017-08-26 12:21 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-08-29 12:25 ` [PATCH 1/3] " Chris Wilson
2017-08-29 13:07 ` Joonas Lahtinen
2017-08-29 13:19   ` Chris Wilson
2017-08-29 13:36 ` Mika Kuoppala
2017-08-29 13:55   ` 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.