diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c index f4972f11c..7eea636e6 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c @@ -249,12 +249,24 @@ free_ref: int nvgpu_ioctl_tsg_dev_open(struct inode *inode, struct file *filp) { struct nvgpu_os_linux *l; + struct gk20a *g; int ret; + gk20a_dbg_fn(""); + l = container_of(inode->i_cdev, struct nvgpu_os_linux, tsg.cdev); - gk20a_dbg_fn(""); + g = &l->g; + + ret = gk20a_busy(g); + if (ret) { + nvgpu_err(g, "failed to power on, %d", ret); + return ret; + } + ret = nvgpu_ioctl_tsg_open(&l->g, filp); + + gk20a_idle(g); gk20a_dbg_fn("done"); return ret; } diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index b06f86ab9..7706d826b 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c @@ -237,6 +237,12 @@ int gk20a_pm_finalize_poweron(struct device *dev) if (platform->has_cde) gk20a_init_cde_support(l); + err = gk20a_sched_ctrl_init(g); + if (err) { + nvgpu_err(g, "failed to init sched control"); + return err; + } + done: if (err) g->power_on = false; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f2bb6dcfb..a282110ac 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -300,12 +300,6 @@ int gk20a_finalize_poweron(struct gk20a *g) nvgpu_warn(g, "could not initialize ctxsw tracing"); #endif - err = gk20a_sched_ctrl_init(g); - if (err) { - nvgpu_err(g, "failed to init sched control"); - goto done; - } - /* Restore the debug setting */ g->ops.fb.set_debug_mode(g, g->mmu_debug_ctrl);