mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/i915: Prevent lock-cycles between GPU waits and GPU resets
We cannot allow ourselves to wait on the GPU while holding any lock as we may need to reset the GPU. While there is not an explicit lock between the two operations, lockdep cannot detect the dependency. So let's tell lockdep about the wait/reset dependency with an explicit lockmap. 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> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190612085246.16374-1-chris@chris-wilson.co.uk
This commit is contained in:
@@ -1444,6 +1444,7 @@ long i915_request_wait(struct i915_request *rq,
|
||||
return -ETIME;
|
||||
|
||||
trace_i915_request_wait_begin(rq, flags);
|
||||
lock_map_acquire(&rq->i915->gt.reset_lockmap);
|
||||
|
||||
/*
|
||||
* Optimistic spin before touching IRQs.
|
||||
@@ -1517,6 +1518,7 @@ long i915_request_wait(struct i915_request *rq,
|
||||
dma_fence_remove_callback(&rq->fence, &wait.cb);
|
||||
|
||||
out:
|
||||
lock_map_release(&rq->i915->gt.reset_lockmap);
|
||||
trace_i915_request_wait_end(rq);
|
||||
return timeout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user