]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Hold a ref to the ring while retiring
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 18 Mar 2019 09:51:46 +0000 (09:51 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 18 Mar 2019 21:00:28 +0000 (21:00 +0000)
commit841a43f1081c6f94542bb695a5433a8c929fb8e7
tree5366b74868567ae514cc57d732254481dbaba83c
parente2f46c32f876c689f8e727eafbb53e6b8fbc43d1
drm/i915: Hold a ref to the ring while retiring

As the final request on a ring may hold the reference to this ring (via
retiring the last pinned context), we may find ourselves chasing a
dangling pointer on completion of the list.

A quick solution is to hold a reference to the ring itself as we retire
along it so that we only free it after we stop dereferencing it.

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/20190318095204.9913-4-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/intel_engine_types.h
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h
drivers/gpu/drm/i915/selftests/mock_engine.c