stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution for Braswell
       [not found] <20181201095231.324-1-chris@chris-wilson.co.uk>
@ 2018-12-01  9:52 ` Chris Wilson
  2018-12-01 18:32   ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2018-12-01  9:52 UTC (permalink / raw)
  To: intel-gfx
  Cc: Chris Wilson, Mika Kuoppala, Tvrtko Ursulin, Joonas Lahtinen, stable

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

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

* Re: [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution for Braswell
  2018-12-01  9:52 ` [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution for Braswell Chris Wilson
@ 2018-12-01 18:32   ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2018-12-01 18:32 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala, Tvrtko Ursulin, Joonas Lahtinen, stable

Quoting Chris Wilson (2018-12-01 09:52:31)
> 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();

Scratch that. Just took ages to hit this time. It seemed so promising!
-Chris

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

end of thread, other threads:[~2018-12-02  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181201095231.324-1-chris@chris-wilson.co.uk>
2018-12-01  9:52 ` [PATCH 7/7] drm/i915/execlists: Apply a full mb before execution for Braswell Chris Wilson
2018-12-01 18:32   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).