gpu: nvgpu: unbind resources during reservation release

nvgpu_profiler_pm_resource_release() right now returns error if PM
resources are already bound. Update this to unbind the resources
explicitly as per the user requirement.

Bug 2510974
Jira NVGPU-5360

Change-Id: Ib71e2d8d3caacd3bc5e29a06af0b90983468d33a
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2398354
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Deepak Nibade
2020-08-13 13:51:50 +05:30
committed by Alex Waterman
parent 4787220ffe
commit 9963b94b4b

View File

@@ -210,8 +210,16 @@ int nvgpu_profiler_pm_resource_release(struct nvgpu_profiler_object *prof,
}
if (prof->bound) {
nvgpu_err(g, "PM resources are bound, cannot release reservation");
return -EINVAL;
nvgpu_log(g, gpu_dbg_prof,
"PM resources alredy bound with profiler handle %u,"
" unbinding for reservation release",
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;
}
}
err = g->ops.pm_reservation.release(g, reservation_id, pm_resource, 0);