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

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

== Series Details ==

Series: drm/i915: Check fence status after serialising with the spinlock
URL   : https://patchwork.freedesktop.org/series/18678/
State : warning

== Summary ==

Series 18678v1 drm/i915: Check fence status after serialising with the spinlock
https://patchwork.freedesktop.org/api/1.0/series/18678/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup force-connector-state:
                pass       -> SKIP       (fi-snb-2520m)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                dmesg-warn -> PASS       (fi-snb-2520m)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> DMESG-WARN (fi-bsw-n3050)

fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:206  dwarn:1   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:78   pass:65   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:223  dwarn:0   dfail:0   fail:2   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:221  dwarn:4   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

dc47d8d6ed4ea669aeccad104fde843fe039b9a5 drm-tip: 2017y-01m-30d-09h-12m-47s UTC integration manifest
4e26edf drm/i915: Check fence status after serialising with the spinlock

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3631/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Check fence status after serialising with the spinlock
  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 ` Joonas Lahtinen
  1 sibling, 0 replies; 3+ messages in thread
From: Joonas Lahtinen @ 2017-01-30 12:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On pe, 2017-01-27 at 13:06 +0000, Chris Wilson wrote:
> A very rare problem we encounter is that as retire the request we find
                                         we -^
> 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

But it uses timeline spinlock?

> sufficient barriers between the execution and the assert in retirement.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[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).