summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/vm_area.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-06-27 13:14:12 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-28 14:14:04 -0400
commite323f562b2e391995c331af718ae49f672b8d2ed (patch)
tree9e1ac4162eaac809ba410b7693f243b1fe47b748 /drivers/gpu/nvgpu/common/mm/vm_area.c
parente8d51f0c32708ce5b42660bce57bf715227e37d5 (diff)
gpu: nvgpu: Keep lock while unreffing mappings
In the vm_area free code, when unreffing the mappings owned by the vm_area, we need to continue holding the VM lock. Also add a comment specifying this requirement in the VM code. Bug 2156667 Change-Id: If0b430f045e4c585fcba2d3176163e5b19be8326 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1763235 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/vm_area.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm_area.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm_area.c b/drivers/gpu/nvgpu/common/mm/vm_area.c
index 663d8999..5d3b0526 100644
--- a/drivers/gpu/nvgpu/common/mm/vm_area.c
+++ b/drivers/gpu/nvgpu/common/mm/vm_area.c
@@ -199,7 +199,6 @@ int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr)
199 return 0; 199 return 0;
200 } 200 }
201 nvgpu_list_del(&vm_area->vm_area_list); 201 nvgpu_list_del(&vm_area->vm_area_list);
202 nvgpu_mutex_release(&vm->update_gmmu_lock);
203 202
204 nvgpu_log(g, gpu_dbg_map, 203 nvgpu_log(g, gpu_dbg_map,
205 "DEL vm_area: pgsz=%#-8x pages=%-9llu " 204 "DEL vm_area: pgsz=%#-8x pages=%-9llu "
@@ -219,6 +218,8 @@ int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr)
219 nvgpu_ref_put(&buffer->ref, __nvgpu_vm_unmap_ref); 218 nvgpu_ref_put(&buffer->ref, __nvgpu_vm_unmap_ref);
220 } 219 }
221 220
221 nvgpu_mutex_release(&vm->update_gmmu_lock);
222
222 /* if this was a sparse mapping, free the va */ 223 /* if this was a sparse mapping, free the va */
223 if (vm_area->sparse) 224 if (vm_area->sparse)
224 g->ops.mm.gmmu_unmap(vm, 225 g->ops.mm.gmmu_unmap(vm,