]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Keep request alive while attaching fences
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 17 Dec 2019 13:47:29 +0000 (13:47 +0000)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 18 Dec 2019 08:55:27 +0000 (10:55 +0200)
commit91f2ffe932c0b1eba835c3cf2f3ef6e7409256b3
treeea0dc4a9cb4826fd6ab11ef0861cb6df4a0699bd
parent05dbd8c6e443deba4c568ffa310f26ab686c9c3a
drm/i915/gem: Keep request alive while attaching fences

Since commit 81691eddafbb ("drm/i915: Protect request retirement with
timeline->mutex"), the request retirement can happen outside of the
struct_mutex serialised only by the timeline->mutex. We drop the
timeline->mutex on submitting the request (i915_request_add) so after
that point, it is liable to be freed. Make sure our local reference is
kept alive until we have finished attaching it to the signalers. (Note
that this erodes the argument that i915_request_add should consume the
reference, but that is a slightly larger patch!)

Fixes: 81691eddafbb ("drm/i915: Protect request retirement with timeline->mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191217134729.3297818-1-chris@chris-wilson.co.uk
(cherry picked from commit e14177f19739d74839eb496a27f5f5d958beaa5b)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c