summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/vm.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.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.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index 13fd641e..3d9dd174 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -1094,6 +1094,11 @@ static void __nvgpu_vm_unmap(struct nvgpu_mapped_buf *mapped_buffer,
1094 nvgpu_kfree(g, mapped_buffer); 1094 nvgpu_kfree(g, mapped_buffer);
1095} 1095}
1096 1096
1097/*
1098 * Note: the update_gmmu_lock of the VM that owns this buffer must be locked
1099 * before calling nvgpu_ref_put() with this function as the unref function
1100 * argument since this can modify the tree of maps.
1101 */
1097void __nvgpu_vm_unmap_ref(struct nvgpu_ref *ref) 1102void __nvgpu_vm_unmap_ref(struct nvgpu_ref *ref)
1098{ 1103{
1099 struct nvgpu_mapped_buf *mapped_buffer = 1104 struct nvgpu_mapped_buf *mapped_buffer =