All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	stable@vger.kernel.org
Subject: [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution for Braswell
Date: Sat,  1 Dec 2018 09:52:31 +0000	[thread overview]
Message-ID: <20181201095231.324-7-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20181201095231.324-1-chris@chris-wilson.co.uk>

Braswell is really picky about having our writes posted to memory before
we execute or else the GPU may see stale values. A wmb() is insufficient
as it only ensures the writes are visible to other cores, we need a full
mb() to ensure the writes are in memory and visible to the GPU.

The most frequent failure in flushing before execution is that we see
stale PTE values and execute the wrong pages.

References: 987abd5c62f9 ("drm/i915/execlists: Force write serialisation into context image vs execution")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/intel_lrc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 0a690c557113..cad1228f6503 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -379,8 +379,12 @@ static u64 execlists_update_context(struct i915_request *rq)
 	 * may not be visible to the HW prior to the completion of the UC
 	 * register write and that we may begin execution from the context
 	 * before its image is complete leading to invalid PD chasing.
+	 *
+	 * Furthermore, Braswell wants a full mb to be sure that the writes
+	 * are coherent in memory (visible to the GPU) prior to execution,
+	 * and not just visible to other CPUs (as is the result of wmb).
 	 */
-	wmb();
+	mb();
 	return ce->lrc_desc;
 }
 
-- 
2.20.0.rc1

  parent reply	other threads:[~2018-12-01 21:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  9:52 [PATCH 1/7] drm/i915: Complete the fences as they are cancelled due to wedging Chris Wilson
2018-12-01  9:52 ` [PATCH 2/7] drm/i915/ringbuffer: Clear semaphore sync registers on ring init Chris Wilson
2018-12-01  9:52 ` [PATCH 3/7] drm/i915: Allocate a common scratch page Chris Wilson
2018-12-01  9:52 ` [PATCH 4/7] drm/i915/selftests: Terminate hangcheck sanitycheck forcibly Chris Wilson
2018-12-01  9:52 ` [PATCH 5/7] drm/i915/selftests: Reorder request allocation vs vma pinning Chris Wilson
2018-12-01  9:52 ` [PATCH 6/7] drm/i915: Pipeline PDP updates for Braswell Chris Wilson
2018-12-01  9:52 ` Chris Wilson [this message]
2018-12-01 18:32   ` [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution " Chris Wilson
2018-12-01 10:00 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/7] drm/i915: Complete the fences as they are cancelled due to wedging Patchwork
2018-12-01 10:03 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-12-01 10:21 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-01 20:34 ` ✓ Fi.CI.IGT: " Patchwork

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=20181201095231.324-7-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=mika.kuoppala@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tvrtko.ursulin@intel.com \
    /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.