From e2c4832a219a7502448cb1084ce0ee48311b80b8 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Mon, 26 Jun 2017 11:05:56 -0700 Subject: gpu: nvgpu: move mclk_init to pstate_pmu_support Preparation for all clock changes should happen in P-state module Bug 1921094 Change-Id: I3bfa7d52eee5b40a41d80b362e064665081694a3 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master/r/1508819 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 11 ----------- drivers/gpu/nvgpu/pstate/pstate.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 65197aca..7506c1dd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -137,9 +137,6 @@ int gk20a_prepare_poweroff(struct gk20a *g) ret |= gk20a_mm_suspend(g); ret |= gk20a_fifo_suspend(g); - if (g->ops.clk.mclk_deinit) - g->ops.clk.mclk_deinit(g); - /* Disable GPCPLL */ if (g->ops.clk.suspend_clk_support) ret |= g->ops.clk.suspend_clk_support(g); @@ -273,14 +270,6 @@ int gk20a_finalize_poweron(struct gk20a *g) goto done; } - if (g->ops.clk.mclk_init) { - err = g->ops.clk.mclk_init(g); - if (err) { - nvgpu_err(g, "failed to set mclk"); - /* Indicate error dont goto done */ - } - } - #ifdef CONFIG_ARCH_TEGRA_18x_SOC if (g->ops.pmupstate) { err = gk20a_init_pstate_pmu_support(g); diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c index 791832cb..4ce7268e 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.c +++ b/drivers/gpu/nvgpu/pstate/pstate.c @@ -26,6 +26,9 @@ static int pstate_sw_setup(struct gk20a *g); void gk20a_deinit_pstate_support(struct gk20a *g) { + if (g->ops.clk.mclk_deinit) + g->ops.clk.mclk_deinit(g); + nvgpu_mutex_destroy(&g->perf_pmu.pstatesobjs.pstate_mutex); } @@ -104,6 +107,14 @@ int gk20a_init_pstate_pmu_support(struct gk20a *g) gk20a_dbg_fn(""); + if (g->ops.clk.mclk_init) { + err = g->ops.clk.mclk_init(g); + if (err) { + nvgpu_err(g, "failed to set mclk"); + /* Indicate error and continue */ + } + } + err = volt_rail_pmu_setup(g); if (err) return err; -- cgit v1.2.2