All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH 2/5] drm/i915/contexts: fix list corruption
Date: Tue, 14 Aug 2012 14:35:14 -0700	[thread overview]
Message-ID: <1344980117-1993-3-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1344980117-1993-1-git-send-email-ben@bwidawsk.net>

After reset we unconditionally reinitialize lists. If the context switch
hasn't yet completed before the suspend, the default context object will
end up on lists that are going to go away when we resume.

The patch forces the context switch to be synchronous before suspend
assuring that the active/inactive tracking is correct at the time of
resume.

References: https://bugs.freedesktop.org/show_bug.cgi?id=52429
Tested-by: Guang A Yang <guang.a.yang@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d992e6..0edec12 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2274,11 +2274,11 @@ int i915_gpu_idle(struct drm_device *dev)
 
 	/* Flush everything onto the inactive list. */
 	for_each_ring(ring, dev_priv, i) {
-		ret = i915_ring_idle(ring);
+		ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID);
 		if (ret)
 			return ret;
 
-		ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID);
+		ret = i915_ring_idle(ring);
 		if (ret)
 			return ret;
 	}
-- 
1.7.11.4

  parent reply	other threads:[~2012-08-14 21:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 21:35 [PATCH 0/5] Some HW context fixes Ben Widawsky
2012-08-14 21:35 ` [PATCH 1/5] drm/i915: Cleanup instdone state Ben Widawsky
2012-08-15  9:14   ` Chris Wilson
2012-08-15 17:43     ` Ben Widawsky
2012-08-14 21:35 ` Ben Widawsky [this message]
2012-08-15 22:50   ` [PATCH 2/5] drm/i915/contexts: fix list corruption Daniel Vetter
2012-08-14 21:35 ` [PATCH 3/5] drm/i915/contexts: Switch to default on resume Ben Widawsky
2012-08-15  9:18   ` Chris Wilson
2012-08-15 15:58     ` Ben Widawsky
2012-08-14 21:35 ` [PATCH 4/5] drm/i915/contexts: Add forced switches Ben Widawsky
2012-08-14 21:35 ` [PATCH 5/5] drm/i915/contexts: Serialize default context init Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344980117-1993-3-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.