]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Protect timeline->hwsp dereferencing
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 19 Sep 2019 11:19:12 +0000 (12:19 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 20 Sep 2019 09:24:13 +0000 (10:24 +0100)
commitd5a2351f6bebd0a9762b7302e382b5f12638bf00
tree0ac922c8f1b7a512734c330102df50e9c6ba5652
parent2d76ac2e8c1d1da2c558cd33dabd0322fe17e883
drm/i915: Protect timeline->hwsp dereferencing

As not only is the signal->timeline volatile, so will be acquiring the
timeline's HWSP. We must first carefully acquire the timeline from the
signaling request and then lock the timeline. With the removal of the
struct_mutex serialisation of request construction, we can have multiple
timelines active at once, and so we must avoid using the nested mutex
lock as it is quite possible for both timelines to be establishing
semaphores on the other and so deadlock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190919111912.21631-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_timeline.c