summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2015-09-10 06:40:21 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-09-16 13:30:06 -0400
commit619031ef03d570319e69545aba200f5b4684913a (patch)
treece3e8bb855d1bf3fb61cbc7f70784bd6a068c564 /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
parentb8faddfe2ad3d52837b0f766d74feb8e6d6f4ce5 (diff)
gpu: nvgpu: enable powergate always while releasing debug session
Currently, while releasing the debug session we enable powergate only if a channel is bound to session If a session has no channel bound to it, and has powergate disabled, then we do not enable powergate when that session is closed Fix this by calling dbg_set_powergate(POWERGATE_ENABLE) always while releasing the session Refcounting and sanity checks in dbg_set_powergate() will take care of situation if powergate was not disabled by the session in first place Bug 1679372 Change-Id: I4e027393c611d3e8ab4f20e195f31871086da736 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/796999 Tested-by: Sandarbh Jain <sanjain@nvidia.com> Reviewed-by: Sandarbh Jain <sanjain@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index c1cca445..4a175a3c 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -282,12 +282,6 @@ static int dbg_unbind_channel_gk20a(struct dbg_session_gk20a *dbg_s)
282 282
283 --g->dbg_sessions; 283 --g->dbg_sessions;
284 284
285 /* Powergate enable is called here as possibility of dbg_session
286 * which called powergate disable ioctl, to be killed without calling
287 * powergate enable ioctl
288 */
289 dbg_set_powergate(dbg_s, NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE);
290
291 dbg_s->ch = NULL; 285 dbg_s->ch = NULL;
292 fput(dbg_s->ch_f); 286 fput(dbg_s->ch_f);
293 dbg_s->ch_f = NULL; 287 dbg_s->ch_f = NULL;
@@ -303,6 +297,7 @@ static int dbg_unbind_channel_gk20a(struct dbg_session_gk20a *dbg_s)
303int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp) 297int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
304{ 298{
305 struct dbg_session_gk20a *dbg_s = filp->private_data; 299 struct dbg_session_gk20a *dbg_s = filp->private_data;
300 struct gk20a *g = dbg_s->g;
306 301
307 gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", dev_name(dbg_s->dev)); 302 gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", dev_name(dbg_s->dev));
308 303
@@ -310,6 +305,14 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
310 if (dbg_s->ch) 305 if (dbg_s->ch)
311 dbg_unbind_channel_gk20a(dbg_s); 306 dbg_unbind_channel_gk20a(dbg_s);
312 307
308 /* Powergate enable is called here as possibility of dbg_session
309 * which called powergate disable ioctl, to be killed without calling
310 * powergate enable ioctl
311 */
312 mutex_lock(&g->dbg_sessions_lock);
313 dbg_set_powergate(dbg_s, NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE);
314 mutex_unlock(&g->dbg_sessions_lock);
315
313 kfree(dbg_s); 316 kfree(dbg_s);
314 return 0; 317 return 0;
315} 318}