From 55668cb82ca125fddd6c7d5bb98fd7c7aa3c6cb7 Mon Sep 17 00:00:00 2001 From: Ramalingam C Date: Thu, 14 Dec 2023 05:41:13 +0000 Subject: [PATCH] gpu: nvgpu: allow powergating during bind_context ioctl Do not check for powergate disablement for bind and unbind of the context ioctls. As bind and unbind of context is just a sw statemachine related ops we can ignore even if the power gating is still on. No need to print the error message. Bug 4397568 Change-Id: Idc71e12a4188cbc1c94c38032a2f1ed435d278ce Signed-off-by: Ramalingam C Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3034385 (cherry picked from commit 5f1dfe20366637f59b04b8968a527dbc3fac0d9f) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3035373 Reviewed-by: Vijayakumar Subbu Tested-by: Tushar Kashalikar GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl_prof.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_prof.c b/drivers/gpu/nvgpu/os/linux/ioctl_prof.c index 7c21a4161..20e70008c 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_prof.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_prof.c @@ -900,7 +900,9 @@ long nvgpu_prof_fops_ioctl(struct file *filp, unsigned int cmd, #ifdef CONFIG_NVGPU_DEBUGGER nvgpu_mutex_acquire(&g->dbg_sessions_lock); - if (g->dbg_powergating_disabled_refcount == 0) { + if (g->dbg_powergating_disabled_refcount == 0 && + cmd != NVGPU_PROFILER_IOCTL_BIND_CONTEXT && + cmd != NVGPU_PROFILER_IOCTL_UNBIND_CONTEXT) { nvgpu_err(g, "powergate is not disabled"); } nvgpu_mutex_release(&g->dbg_sessions_lock);