mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Replace kref for refcounting in nvgpu
- added wrapper struct nvgpu_ref over nvgpu_atomic_t - added nvgpu_ref_* APIs to access the above struct JIRA NVGPU-140 Change-Id: Id47f897995dd4721751f7610b6d4d4fbfe4d6b9a Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1540899 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
8662fae334
commit
3fa47b877d
@@ -155,7 +155,7 @@ static u64 __nvgpu_vm_find_mapping(struct vm_gk20a *vm,
|
||||
else
|
||||
mapped_buffer->own_mem_ref = true;
|
||||
}
|
||||
kref_get(&mapped_buffer->ref);
|
||||
nvgpu_ref_get(&mapped_buffer->ref);
|
||||
|
||||
nvgpu_log(g, gpu_dbg_map,
|
||||
"gv: 0x%04x_%08x + 0x%-7zu "
|
||||
@@ -380,7 +380,7 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm,
|
||||
mapped_buffer->user_mapped = user_mapped ? 1 : 0;
|
||||
mapped_buffer->own_mem_ref = user_mapped;
|
||||
nvgpu_init_list_node(&mapped_buffer->buffer_list);
|
||||
kref_init(&mapped_buffer->ref);
|
||||
nvgpu_ref_init(&mapped_buffer->ref);
|
||||
|
||||
err = nvgpu_insert_mapped_buf(vm, mapped_buffer);
|
||||
if (err) {
|
||||
@@ -425,6 +425,6 @@ void nvgpu_vm_unmap(struct vm_gk20a *vm, u64 offset)
|
||||
return;
|
||||
}
|
||||
|
||||
kref_put(&mapped_buffer->ref, gk20a_vm_unmap_locked_kref);
|
||||
nvgpu_ref_put(&mapped_buffer->ref, gk20a_vm_unmap_locked_ref);
|
||||
nvgpu_mutex_release(&vm->update_gmmu_lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user