diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 789e6af4e..07015a304 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c @@ -1275,10 +1275,6 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) if (err) return err; - err = gk20a_busy(dbg_s->dev); - if (err) - return -EPERM; - /*do elpg disable before clock gating */ gk20a_pmu_pg_global_enable(g, false); @@ -1330,7 +1326,6 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) gk20a_pmu_pg_global_enable(g, true); gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module idle"); - gk20a_idle(dbg_s->dev); gk20a_idle(g->dev); } @@ -1426,6 +1421,7 @@ static int nvgpu_dbg_gpu_ioctl_hwpm_ctxsw_mode(struct dbg_session_gk20a *dbg_s, "session doesn't have a valid reservation"); } + err = gk20a_busy(g->dev); if (err) { gk20a_err(dev_from_gk20a(g), "failed to poweron");