summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_dbg.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_dbg.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
index f8bdd19b..c8d7468e 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
@@ -178,8 +178,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
178 * calling powergate/timeout enable ioctl 178 * calling powergate/timeout enable ioctl
179 */ 179 */
180 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 180 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
181 g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, 181 g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false);
182 NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE);
183 nvgpu_dbg_timeout_enable(dbg_s, NVGPU_DBG_GPU_IOCTL_TIMEOUT_ENABLE); 182 nvgpu_dbg_timeout_enable(dbg_s, NVGPU_DBG_GPU_IOCTL_TIMEOUT_ENABLE);
184 183
185 /* If this session owned the perf buffer, release it */ 184 /* If this session owned the perf buffer, release it */
@@ -651,7 +650,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
651 * disabling/enabling powergating when processing reg ops 650 * disabling/enabling powergating when processing reg ops
652 */ 651 */
653 powergate_err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, 652 powergate_err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s,
654 NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE); 653 true);
655 is_pg_disabled = true; 654 is_pg_disabled = true;
656 } 655 }
657 656
@@ -701,7 +700,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
701 if (is_pg_disabled) { 700 if (is_pg_disabled) {
702 powergate_err = 701 powergate_err =
703 g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, 702 g->ops.dbg_session_ops.dbg_set_powergate(dbg_s,
704 NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE); 703 false);
705 } 704 }
706 } 705 }
707 706
@@ -725,7 +724,14 @@ static int nvgpu_ioctl_powergate_gk20a(struct dbg_session_gk20a *dbg_s,
725 g->name, args->mode); 724 g->name, args->mode);
726 725
727 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 726 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
728 err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, args->mode); 727 if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE) {
728 err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, true);
729 } else if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE) {
730 err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false);
731 } else {
732 nvgpu_err(g, "invalid powergate mode");
733 err = -EINVAL;
734 }
729 nvgpu_mutex_release(&g->dbg_sessions_lock); 735 nvgpu_mutex_release(&g->dbg_sessions_lock);
730 return err; 736 return err;
731} 737}