diff --git a/drivers/gpu/nvgpu/common/gsp/gsp_init.c b/drivers/gpu/nvgpu/common/gsp/gsp_init.c index b698ecb12..3cd95cf3c 100644 --- a/drivers/gpu/nvgpu/common/gsp/gsp_init.c +++ b/drivers/gpu/nvgpu/common/gsp/gsp_init.c @@ -47,12 +47,15 @@ void nvgpu_gsp_isr_support(struct gk20a *g, bool enable) nvgpu_mutex_release(&g->gsp->isr_mutex); } +void nvgpu_gsp_suspend(struct gk20a *g) +{ + nvgpu_gsp_isr_support(g, false); +} + void nvgpu_gsp_sw_deinit(struct gk20a *g) { if (g->gsp != NULL) { - nvgpu_gsp_isr_support(g, false); - nvgpu_mutex_destroy(&g->gsp->isr_mutex); #ifdef CONFIG_NVGPU_FALCON_DEBUG nvgpu_falcon_dbg_buf_destroy(g->gsp->gsp_flcn); diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index bfc70e800..a7c39dcb9 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -341,8 +341,12 @@ int nvgpu_prepare_poweroff(struct gk20a *g) #ifdef CONFIG_NVGPU_GSP_STRESS_TEST ret = nvgpu_gsp_stress_test_halt(g, true); - if (ret != 0) + if (ret != 0) { nvgpu_err(g, "Failed to halt GSP stress test"); + } +#endif +#if defined(CONFIG_NVGPU_GSP_SCHEDULER) + nvgpu_gsp_suspend(g); #endif nvgpu_falcons_sw_free(g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/gsp.h b/drivers/gpu/nvgpu/include/nvgpu/gsp.h index 0fb837e81..e172edcfb 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gsp.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gsp.h @@ -27,6 +27,7 @@ struct nvgpu_gsp; int nvgpu_gsp_sw_init(struct gk20a *g); int nvgpu_gsp_bootstrap(struct gk20a *g); +void nvgpu_gsp_suspend(struct gk20a *g); void nvgpu_gsp_sw_deinit(struct gk20a *g); void nvgpu_gsp_isr_support(struct gk20a *g, bool enable); void nvgpu_gsp_isr_mutex_aquire(struct gk20a *g);