]> 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)
commita53772b8ddc7ecde90c4060c1792c72706545662
tree5366b74868567ae514cc57d732254481dbaba83c
parent06a31115dc02b01a716a1423b9fa3aa5de28e41e
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