From ed0c49a0b160f234f70474d299b2740e950158b8 Mon Sep 17 00:00:00 2001 From: Neil Gabriel Date: Thu, 26 Jun 2014 18:02:32 -0500 Subject: gpu: nvgpu: Initialize ELPG ref-count early. gk20a_pmu_disable_elpg can be called before the PMU driver has received and processed the INIT message from the PMU. If change ensures that the ELPG ref-count has been initialized to zero before that can happen. Bug 200016313 Change-Id: Ic80ec1ee69b1eb0499effb1abf556f78cb041f5e Signed-off-by: Neil Gabriel Reviewed-on: http://git-master/r/429161 Reviewed-on: http://git-master/r/433299 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Shih Tested-by: Robert Shih Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index f77ad10b..9d52c943 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -1915,6 +1915,9 @@ int gk20a_init_pmu_setup_sw(struct gk20a *g) gk20a_dbg_fn(""); + /* start with elpg disabled until first enable call */ + pmu->elpg_refcnt = 0; + if (pmu->sw_ready) { for (i = 0; i < pmu->mutex_cnt; i++) { pmu->mutex[i].id = i; @@ -2478,9 +2481,6 @@ static int pmu_init_powergating(struct pmu_gk20a *pmu) gk20a_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, pmu_handle_pg_elpg_msg, pmu, &seq, ~0); - /* start with elpg disabled until first enable call */ - pmu->elpg_refcnt = 0; - pmu->pmu_state = PMU_STATE_ELPG_BOOTING; return 0; -- cgit v1.2.2