intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gt: More delays for gen7 flushing
@ 2019-11-12 15:17 Chris Wilson
  2019-11-12 15:17 ` [Intel-gfx] " Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 15:17 UTC (permalink / raw)
  To: intel-gfx

live_blt is still failing on hsw, showing the hallmark of incoherency.
Since we are fairly certain that the interrupt is after the seqno is
visible, the other possibility is that the seqno is before the writes to
memory are flushed. Throw in some more MI_FLUSH_DW before the breadcrumb
to try and flush any internal pipelines.

References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
Testcase: igt/i915_selftest/live_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_ring_submission.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index fc29df712810..14d115891ed9 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -454,9 +454,11 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
 	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
 	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
 
-	*cs++ = MI_FLUSH_DW;
-	*cs++ = 0;
-	*cs++ = 0;
+	for (i = 0; i < 7; i++) {
+		*cs++ = MI_FLUSH_DW;
+		*cs++ = 0;
+		*cs++ = 0;
+	}
 
 	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
 	*cs++ = I915_GEM_HWS_SEQNO_ADDR | MI_FLUSH_DW_USE_GTT;
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH] drm/i915/gt: More delays for gen7 flushing
  2019-11-12 15:17 [PATCH] drm/i915/gt: More delays for gen7 flushing Chris Wilson
@ 2019-11-12 15:17 ` Chris Wilson
  2019-11-12 16:09 ` [PATCH v2] drm/i915/gt: Flush gen7 even harder Chris Wilson
  2019-11-12 21:36 ` ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2) Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 15:17 UTC (permalink / raw)
  To: intel-gfx

live_blt is still failing on hsw, showing the hallmark of incoherency.
Since we are fairly certain that the interrupt is after the seqno is
visible, the other possibility is that the seqno is before the writes to
memory are flushed. Throw in some more MI_FLUSH_DW before the breadcrumb
to try and flush any internal pipelines.

References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
Testcase: igt/i915_selftest/live_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_ring_submission.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index fc29df712810..14d115891ed9 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -454,9 +454,11 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
 	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
 	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
 
-	*cs++ = MI_FLUSH_DW;
-	*cs++ = 0;
-	*cs++ = 0;
+	for (i = 0; i < 7; i++) {
+		*cs++ = MI_FLUSH_DW;
+		*cs++ = 0;
+		*cs++ = 0;
+	}
 
 	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
 	*cs++ = I915_GEM_HWS_SEQNO_ADDR | MI_FLUSH_DW_USE_GTT;
-- 
2.24.0

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

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

* [PATCH v2] drm/i915/gt: Flush gen7 even harder
  2019-11-12 15:17 [PATCH] drm/i915/gt: More delays for gen7 flushing Chris Wilson
  2019-11-12 15:17 ` [Intel-gfx] " Chris Wilson
@ 2019-11-12 16:09 ` Chris Wilson
  2019-11-12 16:09   ` [Intel-gfx] " Chris Wilson
  2019-11-12 16:36   ` Mika Kuoppala
  2019-11-12 21:36 ` ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2) Patchwork
  2 siblings, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 16:09 UTC (permalink / raw)
  To: intel-gfx

live_blt is still failing on hsw, showing the hallmark of incoherency.
Since we are fairly certain that the interrupt is after the seqno is
visible, the other possibility is that the seqno is before the writes to
memory are flushed. Throw in an TLB invalidate before the breadcrumb as
we are reasonably confident that forces a CS stall.

References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
Testcase: igt/i915_selftest/live_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
Try Mika's suggestion of an invalidate first.
---
 drivers/gpu/drm/i915/gt/intel_ring_submission.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index fc29df712810..e8bee44add34 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -454,8 +454,9 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
 	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
 	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
 
-	*cs++ = MI_FLUSH_DW;
-	*cs++ = 0;
+	*cs++ = (MI_FLUSH_DW | MI_INVALIDATE_TLB |
+		 MI_FLUSH_DW_STORE_INDEX | MI_FLUSH_DW_OP_STOREDW);
+	*cs++ = I915_GEM_HWS_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT;
 	*cs++ = 0;
 
 	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH v2] drm/i915/gt: Flush gen7 even harder
  2019-11-12 16:09 ` [PATCH v2] drm/i915/gt: Flush gen7 even harder Chris Wilson
@ 2019-11-12 16:09   ` Chris Wilson
  2019-11-12 16:36   ` Mika Kuoppala
  1 sibling, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 16:09 UTC (permalink / raw)
  To: intel-gfx

live_blt is still failing on hsw, showing the hallmark of incoherency.
Since we are fairly certain that the interrupt is after the seqno is
visible, the other possibility is that the seqno is before the writes to
memory are flushed. Throw in an TLB invalidate before the breadcrumb as
we are reasonably confident that forces a CS stall.

References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
Testcase: igt/i915_selftest/live_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
Try Mika's suggestion of an invalidate first.
---
 drivers/gpu/drm/i915/gt/intel_ring_submission.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index fc29df712810..e8bee44add34 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -454,8 +454,9 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
 	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
 	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
 
-	*cs++ = MI_FLUSH_DW;
-	*cs++ = 0;
+	*cs++ = (MI_FLUSH_DW | MI_INVALIDATE_TLB |
+		 MI_FLUSH_DW_STORE_INDEX | MI_FLUSH_DW_OP_STOREDW);
+	*cs++ = I915_GEM_HWS_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT;
 	*cs++ = 0;
 
 	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
-- 
2.24.0

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

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

* Re: [PATCH v2] drm/i915/gt: Flush gen7 even harder
  2019-11-12 16:09 ` [PATCH v2] drm/i915/gt: Flush gen7 even harder Chris Wilson
  2019-11-12 16:09   ` [Intel-gfx] " Chris Wilson
@ 2019-11-12 16:36   ` Mika Kuoppala
  2019-11-12 16:36     ` [Intel-gfx] " Mika Kuoppala
  1 sibling, 1 reply; 8+ messages in thread
From: Mika Kuoppala @ 2019-11-12 16:36 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> live_blt is still failing on hsw, showing the hallmark of incoherency.
> Since we are fairly certain that the interrupt is after the seqno is
> visible, the other possibility is that the seqno is before the writes to
> memory are flushed. Throw in an TLB invalidate before the breadcrumb as
> we are reasonably confident that forces a CS stall.
>
> References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
> References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
> Testcase: igt/i915_selftest/live_blt
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> Try Mika's suggestion of an invalidate first.
> ---
>  drivers/gpu/drm/i915/gt/intel_ring_submission.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> index fc29df712810..e8bee44add34 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> @@ -454,8 +454,9 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
>  	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
>  	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
>  
> -	*cs++ = MI_FLUSH_DW;
> -	*cs++ = 0;
> +	*cs++ = (MI_FLUSH_DW | MI_INVALIDATE_TLB |
> +		 MI_FLUSH_DW_STORE_INDEX | MI_FLUSH_DW_OP_STOREDW);
> +	*cs++ = I915_GEM_HWS_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT;

If/when it doesn't work, we could try to push the invalidate to both
parts and/or tickle the same cacheline.

Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  	*cs++ = 0;
>  
>  	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH v2] drm/i915/gt: Flush gen7 even harder
  2019-11-12 16:36   ` Mika Kuoppala
@ 2019-11-12 16:36     ` Mika Kuoppala
  0 siblings, 0 replies; 8+ messages in thread
From: Mika Kuoppala @ 2019-11-12 16:36 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> live_blt is still failing on hsw, showing the hallmark of incoherency.
> Since we are fairly certain that the interrupt is after the seqno is
> visible, the other possibility is that the seqno is before the writes to
> memory are flushed. Throw in an TLB invalidate before the breadcrumb as
> we are reasonably confident that forces a CS stall.
>
> References: f9228f765873 ("drm/i915/gt: Try an extra flush on the Haswell blitter")
> References: https://bugs.freedesktop.org/show_bug.cgi?id=112147
> Testcase: igt/i915_selftest/live_blt
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> Try Mika's suggestion of an invalidate first.
> ---
>  drivers/gpu/drm/i915/gt/intel_ring_submission.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> index fc29df712810..e8bee44add34 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
> @@ -454,8 +454,9 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs)
>  	GEM_BUG_ON(i915_request_active_timeline(rq)->hwsp_ggtt != rq->engine->status_page.vma);
>  	GEM_BUG_ON(offset_in_page(i915_request_active_timeline(rq)->hwsp_offset) != I915_GEM_HWS_SEQNO_ADDR);
>  
> -	*cs++ = MI_FLUSH_DW;
> -	*cs++ = 0;
> +	*cs++ = (MI_FLUSH_DW | MI_INVALIDATE_TLB |
> +		 MI_FLUSH_DW_STORE_INDEX | MI_FLUSH_DW_OP_STOREDW);
> +	*cs++ = I915_GEM_HWS_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT;

If/when it doesn't work, we could try to push the invalidate to both
parts and/or tickle the same cacheline.

Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  	*cs++ = 0;
>  
>  	*cs++ = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_DW_STORE_INDEX;
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2)
  2019-11-12 15:17 [PATCH] drm/i915/gt: More delays for gen7 flushing Chris Wilson
  2019-11-12 15:17 ` [Intel-gfx] " Chris Wilson
  2019-11-12 16:09 ` [PATCH v2] drm/i915/gt: Flush gen7 even harder Chris Wilson
@ 2019-11-12 21:36 ` Patchwork
  2019-11-12 21:36   ` [Intel-gfx] " Patchwork
  2 siblings, 1 reply; 8+ messages in thread
From: Patchwork @ 2019-11-12 21:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/gt: More delays for gen7 flushing (rev2)
URL   : https://patchwork.freedesktop.org/series/69360/
State : failure

== Summary ==

Applying: drm/i915/gt: Flush gen7 even harder
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/gt/intel_ring_submission.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

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

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

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2)
  2019-11-12 21:36 ` ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2) Patchwork
@ 2019-11-12 21:36   ` Patchwork
  0 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2019-11-12 21:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/gt: More delays for gen7 flushing (rev2)
URL   : https://patchwork.freedesktop.org/series/69360/
State : failure

== Summary ==

Applying: drm/i915/gt: Flush gen7 even harder
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/gt/intel_ring_submission.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

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

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

end of thread, other threads:[~2019-11-12 21:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 15:17 [PATCH] drm/i915/gt: More delays for gen7 flushing Chris Wilson
2019-11-12 15:17 ` [Intel-gfx] " Chris Wilson
2019-11-12 16:09 ` [PATCH v2] drm/i915/gt: Flush gen7 even harder Chris Wilson
2019-11-12 16:09   ` [Intel-gfx] " Chris Wilson
2019-11-12 16:36   ` Mika Kuoppala
2019-11-12 16:36     ` [Intel-gfx] " Mika Kuoppala
2019-11-12 21:36 ` ✗ Fi.CI.BAT: failure for drm/i915/gt: More delays for gen7 flushing (rev2) Patchwork
2019-11-12 21:36   ` [Intel-gfx] " Patchwork

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).