summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Gabriel <ngabriel@nvidia.com>2014-06-26 18:02:32 -0500
committerWinnie Hsu <whsu@nvidia.com>2015-01-06 18:30:21 -0800
commit9dfa869a6f91fc29b61a55fbf071d2f82c40f5dd (patch)
treebff3f94e5e98125f07c14f32397e6a1cacc1d9d8
parent0ba9943195898205134749a6b2b023569ecbe067 (diff)
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 Bug 200055546 Change-Id: Ic80ec1ee69b1eb0499effb1abf556f78cb041f5e Signed-off-by: Neil Gabriel <ngabriel@nvidia.com> Reviewed-on: http://git-master/r/431927 Reviewed-on: http://git-master/r/436302 (cherry picked from commit dad127648262a76180259525ac660ffa8307f69b) Reviewed-on: http://git-master/r/655950 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index c69ab97252ce..21e4d611611c 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -1523,6 +1523,10 @@ int gk20a_init_pmu_setup_sw(struct gk20a *g)
gk20a_dbg_fn("");
+ /* start with elpg disabled until first enable call */
+ mutex_init(&pmu->elpg_mutex);
+ pmu->elpg_refcnt = 0;
+
if (pmu->sw_ready) {
for (i = 0; i < pmu->mutex_cnt; i++) {
pmu->mutex[i].id = i;
@@ -1664,7 +1668,6 @@ int gk20a_init_pmu_setup_sw(struct gk20a *g)
pmu->sw_ready = true;
skip_init:
- mutex_init(&pmu->elpg_mutex);
mutex_init(&pmu->isr_mutex);
mutex_init(&pmu->isr_enable_lock);
mutex_init(&pmu->pmu_copy_lock);
@@ -2117,9 +2120,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_STARTING;
return 0;