]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Drop vm.ref for duplicate vma on construction
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Jul 2020 08:32:03 +0000 (09:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Jul 2020 12:48:00 +0000 (13:48 +0100)
commite9321df7e2a48debbe2137c31269a7cb2c64ebd8
treefa892b062e82caaeb00f67ded123fd2c6b06ceaf
parentc61650e19bfc5b2727a3608f88ef38c0da81cc59
drm/i915: Drop vm.ref for duplicate vma on construction

As we allow for parallel threads to create the same vma instance
concurrently, and we only filter out the duplicates upon reacquiring the
spinlock for the rbtree, we have to free the loser of the constructors'
race. When freeing, we should also drop any resource references acquired
for the redundant vma.

Fixes: dc2b06adfaf3 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v5.5+
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200702083225.20044-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_vma.c