gpu: nvgpu: prof: print error if profiling with PG enabled

Prior to starting any profiling session, GPU power features should be
disabled, not doing this can result in unexpected behavior, print a
error message under such situations.

Jira NVGPU-7326
Bug 3579926

Change-Id: Ia9716d73ed945a588792a7d843aed64bf3b7f83b
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2701501
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Antony Clince Alex
2022-04-22 11:09:18 +00:00
committed by mobile promotions
parent e95843bb57
commit 0b0b68be72

View File

@@ -894,6 +894,14 @@ long nvgpu_prof_fops_ioctl(struct file *filp, unsigned int cmd,
nvgpu_log(g, gpu_dbg_prof, "Profiler handle %u received IOCTL cmd %u",
prof->prof_handle, cmd);
#ifdef CONFIG_NVGPU_DEBUGGER
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
if (g->dbg_powergating_disabled_refcount == 0) {
nvgpu_err(g, "powergate is not disabled");
}
nvgpu_mutex_release(&g->dbg_sessions_lock);
#endif
nvgpu_mutex_acquire(&prof->ioctl_lock);
nvgpu_speculation_barrier();