gpu: nvgpu: Init sema pool for sema gpfifo tracking

Initialize sema pool for the vm, when
NVGPU_SUPPORT_SEMA_BASED_GPFIFO_GET is set

JIRA NVGPU-9588

Change-Id: I3f21a09b9e4af3d1cca16a97d7c94bee605e3ed6
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2898142
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ramalingam C
2023-05-03 18:57:58 +00:00
committed by mobile promotions
parent 4e28efec1a
commit 32f6f9c5d0

View File

@@ -340,7 +340,8 @@ static int nvgpu_init_sema_pool(struct vm_gk20a *vm)
/*
* Don't waste the memory on semaphores if we don't need them.
*/
if (nvgpu_has_syncpoints(g)) {
if (nvgpu_has_syncpoints(g) &&
!nvgpu_is_enabled(g, NVGPU_SUPPORT_SEMA_BASED_GPFIFO_GET)) {
return 0;
}
@@ -927,7 +928,8 @@ static void nvgpu_vm_remove(struct vm_gk20a *vm)
* pool involves unmapping a GMMU mapping which means aquiring the
* update_gmmu_lock.
*/
if (!nvgpu_has_syncpoints(g)) {
if (!nvgpu_has_syncpoints(g) ||
nvgpu_is_enabled(g, NVGPU_SUPPORT_SEMA_BASED_GPFIFO_GET)) {
if (vm->sema_pool != NULL) {
nvgpu_semaphore_pool_unmap(vm->sema_pool, vm);
nvgpu_semaphore_pool_put(vm->sema_pool);