]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Protect i915_request_await_start from early waits
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 27 Feb 2020 08:57:14 +0000 (08:57 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 28 Feb 2020 13:35:11 +0000 (13:35 +0000)
commit3e751e4928760562cdd714056aa9dd121af07d79
tree529eea0047311e9e77d3cd99ba60d8e024b42152
parent6992b6278c6115476658c0e53f11b5278d74e4b0
drm/i915: Protect i915_request_await_start from early waits

We need to be extremely careful inside i915_request_await_start() as it
needs to walk the list of requests in the foreign timeline with very
little protection. As we hold our own timeline mutex, we can not nest
inside the signaler's timeline mutex, so all that remains is our RCU
protection. However, to be safe we need to tell the compiler that we may
be traversing the list only under RCU protection, and furthermore we
need to start declaring requests as elements of the timeline from their
construction.

Fixes: 1f0a522bec3d ("drm/i915: Eliminate the trylock for awaiting an earlier request")
Fixes: 2d76ac2e8c1d ("drm/i915: Lock signaler timeline while navigating")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227085723.1961649-11-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_request.c