Skip to content

Commit

Permalink
drm/i915: Claim vma while under closed_lock in i915_vma_parked()
Browse files Browse the repository at this point in the history
Remove the vma we wish to destroy from the gt->closed_list to avoid
having two i915_vma_parked() try and free it.

Fixes: aa5e445 ("drm/i915/gem: Try to flush pending unbind events")
References: 2850748 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
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/20191205214159.829727-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Dec 6, 2019
1 parent d315fe8 commit 7785318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/i915_vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,9 @@ void i915_vma_parked(struct intel_gt *gt)
if (!kref_get_unless_zero(&obj->base.refcount))
continue;

if (!i915_vm_tryopen(vm)) {
if (i915_vm_tryopen(vm)) {
list_del_init(&vma->closed_link);
} else {
i915_gem_object_put(obj);
obj = NULL;
}
Expand Down

0 comments on commit 7785318

Please sign in to comment.