intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Check fence status after serialising with the spinlock
@ 2017-01-27 13:06 Chris Wilson
  2017-01-30 11:24 ` ✗ Fi.CI.BAT: warning for " Patchwork
  2017-01-30 12:27 ` [PATCH] " Joonas Lahtinen
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2017-01-27 13:06 UTC (permalink / raw)
  To: intel-gfx

A very rare problem we encounter is that as retire the request we find
that it appears to not have been yet executed. Other than malevolent hw,
one possible explanation is that the update of the fence status on one
cpu (an atomic_dec_and_test) is not yet visible to the retiree on
another cpu. However, since retirement is serialised with execution via
a fence-local spinlock, we can use these to ensure that we have
sufficient barriers between the execution and the assert in retirement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_request.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 72b7f7d9461d..53966e10c1d8 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -210,10 +210,7 @@ static void i915_gem_request_retire(struct drm_i915_gem_request *request)
 	struct i915_gem_active *active, *next;
 
 	lockdep_assert_held(&request->i915->drm.struct_mutex);
-	GEM_BUG_ON(!i915_sw_fence_signaled(&request->submit));
-	GEM_BUG_ON(!i915_sw_fence_signaled(&request->execute));
 	GEM_BUG_ON(!i915_gem_request_completed(request));
-	GEM_BUG_ON(!request->i915->gt.active_requests);
 
 	trace_i915_gem_request_retire(request);
 
@@ -221,6 +218,10 @@ static void i915_gem_request_retire(struct drm_i915_gem_request *request)
 	list_del_init(&request->link);
 	spin_unlock_irq(&engine->timeline->lock);
 
+	GEM_BUG_ON(!i915_sw_fence_signaled(&request->submit));
+	GEM_BUG_ON(!i915_sw_fence_signaled(&request->execute));
+	GEM_BUG_ON(!request->i915->gt.active_requests);
+
 	/* We know the GPU must have read the request to have
 	 * sent us the seqno + interrupt, so use the position
 	 * of tail of the request to update the last known position
-- 
2.11.0

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

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

end of thread, other threads:[~2017-01-30 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-27 13:06 [PATCH] drm/i915: Check fence status after serialising with the spinlock Chris Wilson
2017-01-30 11:24 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-01-30 12:27 ` [PATCH] " Joonas Lahtinen

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