From a6e5b76cbff3713220da14b5abff282130b15ffe Mon Sep 17 00:00:00 2001 From: Antony Clince Alex Date: Tue, 1 Feb 2022 08:04:18 +0000 Subject: [PATCH] gpu: nvgpu: profiler: update reservation policy Update profiler object reservation policy to reject any subsequent reserve request made after the intial reserve->bind stage. Bug 3480919 Change-Id: I3e25f22d907d7e06f4cf73347e7bd07e2f675749 Signed-off-by: Antony Clince Alex Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2662360 Reviewed-by: Vaibhav Kachore GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/profiler/profiler.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/nvgpu/common/profiler/profiler.c b/drivers/gpu/nvgpu/common/profiler/profiler.c index 62bf30d83..35bb13d24 100644 --- a/drivers/gpu/nvgpu/common/profiler/profiler.c +++ b/drivers/gpu/nvgpu/common/profiler/profiler.c @@ -178,16 +178,9 @@ int nvgpu_profiler_pm_resource_reserve(struct nvgpu_profiler_object *prof, } if (prof->bound) { - nvgpu_log(g, gpu_dbg_prof, - "PM resources alredy bound with profiler handle %u," - " unbinding for new reservation", - prof->prof_handle); - err = nvgpu_profiler_unbind_pm_resources(prof); - if (err != 0) { - nvgpu_err(g, "Profiler handle %u failed to unbound, err %d", - prof->prof_handle, err); - return err; - } + nvgpu_err(g, "PM resources already bound with profiler handle" + " %u, rejecting reserve request", prof->prof_handle); + return -EEXIST; } err = g->ops.pm_reservation.acquire(g, reservation_id, pm_resource,