From 65e4f3de094ac286d981bceed832d97738556655 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 28 Jun 2018 11:19:53 -0700 Subject: gpu: nvgpu: Move the unlock in nvgpu_vm_area_free again Move the lock release to cover the g->ops.mm.gmmu_unmap() call as well since this too must be called under the VM lock. Bug 2156667 Change-Id: I17d819d1341e211a3d0bd0ecb7cf09884eaca767 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1764598 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/vm_area.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/common/mm') diff --git a/drivers/gpu/nvgpu/common/mm/vm_area.c b/drivers/gpu/nvgpu/common/mm/vm_area.c index 5d3b0526..5a28b7bc 100644 --- a/drivers/gpu/nvgpu/common/mm/vm_area.c +++ b/drivers/gpu/nvgpu/common/mm/vm_area.c @@ -218,8 +218,6 @@ int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr) nvgpu_ref_put(&buffer->ref, __nvgpu_vm_unmap_ref); } - nvgpu_mutex_release(&vm->update_gmmu_lock); - /* if this was a sparse mapping, free the va */ if (vm_area->sparse) g->ops.mm.gmmu_unmap(vm, @@ -231,6 +229,8 @@ int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr) true, NULL); + nvgpu_mutex_release(&vm->update_gmmu_lock); + nvgpu_free(vm->vma[vm_area->pgsz_idx], vm_area->addr); nvgpu_kfree(g, vm_area); -- cgit v1.2.2