diff options
author | Chris Wilson <[email protected]> | 2017-09-18 17:27:34 +0100 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2017-09-22 12:47:19 +0100 |
commit | de4d2106f88ad7d98bf3adc602885d1d9071b644 (patch) | |
tree | 72474958d42400b8cded1e4f23627cee8c701682 | |
parent | 17b51ad8e5c051032d8e1d698e7dfd01d9133a92 (diff) |
drm/i915: Check waiter->seqno carefully in case of preemption
If preemption occurs at precisely the right moment, we may decide that
the wait is complete even though the wait's request is no longer
executing (having been preempted). We handle this situation by double
checking that request following deciding whether the wait is complete.
Reported-by: Michał Winiarski <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: Michał Winiarski <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Michał Winiarski <[email protected]>
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 2190e42ba310..bd38c6983eec 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1053,10 +1053,13 @@ static void notify_ring(struct intel_engine_cs *engine) */ if (i915_seqno_passed(intel_engine_get_seqno(engine), wait->seqno)) { + struct drm_i915_gem_request *waiter = wait->request; + wakeup = true; if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, - &wait->request->fence.flags)) - rq = i915_gem_request_get(wait->request); + &waiter->fence.flags) && + intel_wait_check_request(wait, waiter)) + rq = i915_gem_request_get(waiter); } if (wakeup) |