summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-06-18 15:37:44 +0300
committerMatthew Pedro <mapedro@nvidia.com>2015-02-17 10:30:51 -0800
commite29ad67434ceab33a35812f10ce10fdfa63a5c56 (patch)
treec9bc1e9ead2da79ccf37c854e8d2b887d4477098 /drivers/gpu
parent73a561a53469912d94c0dea866646c87ec257bef (diff)
gu: nvgpu: Add PMU state ELPG booting
Add PMU state ELPG booting. Prevent ISR processing when PMU is in OFF state. Bug 200006956 Change-Id: Ibcf69a2d81965cc87f520bf864c4425681f04531 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Naveen Kumar S <nkumars@nvidia.com> Reviewed-on: http://git-master/r/424769 (cherry picked from commit f9ce5a2cdf667f8e41f7ed4035678cc1198dc308) Reviewed-on: http://git-master/r/657487 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Venkat Moganty <vmoganty@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c14
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.h14
2 files changed, 18 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 62b9a022351c..7b960b8adab0 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -3,7 +3,7 @@
*
* GK20A PMU (aka. gPMU outside gk20a context)
*
- * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -1995,6 +1995,8 @@ int gk20a_init_pmu_support(struct gk20a *g)
err = gk20a_init_pmu_setup_hw1(g);
if (err)
return err;
+
+ pmu->pmu_state = PMU_STATE_STARTING;
}
return err;
@@ -2025,7 +2027,7 @@ static void pmu_handle_pg_elpg_msg(struct gk20a *g, struct pmu_msg *msg,
case PMU_PG_ELPG_MSG_DISALLOW_ACK:
gk20a_dbg_pmu("DISALLOW is acknowledged from PMU");
pmu->elpg_stat = PMU_ELPG_STAT_OFF;
- if (pmu->pmu_state == PMU_STATE_STARTING)
+ if (pmu->pmu_state == PMU_STATE_ELPG_BOOTING)
pmu->pmu_state = PMU_STATE_ELPG_BOOTED;
schedule_work(&pmu->pg_init);
break;
@@ -2122,7 +2124,10 @@ 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);
- pmu->pmu_state = PMU_STATE_STARTING;
+ /* start with elpg disabled until first enable call */
+ pmu->elpg_refcnt = 0;
+
+ pmu->pmu_state = PMU_STATE_ELPG_BOOTING;
return 0;
}
@@ -2891,7 +2896,8 @@ void gk20a_pmu_isr(struct gk20a *g)
gk20a_dbg_pmu("received falcon interrupt: 0x%08x", intr);
- if (!intr) {
+ if (!intr || pmu->pmu_state == PMU_STATE_OFF) {
+ gk20a_writel(g, pwr_falcon_irqsclr_r(), intr);
mutex_unlock(&pmu->isr_mutex);
mutex_unlock(&pmu->isr_enable_lock);
return;
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
index a577890edd45..07903fcfac73 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
@@ -3,7 +3,7 @@
*
* GK20A PMU (aka. gPMU outside gk20a context)
*
- * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -988,11 +988,13 @@ struct pmu_pg_stats {
/* Choices for pmu_state */
#define PMU_STATE_OFF 0 /* PMU is off */
-#define PMU_STATE_STARTING 1 /* PMU is booting */
-#define PMU_STATE_ELPG_BOOTED 2 /* ELPG is initialized */
-#define PMU_STATE_LOADING_PG_BUF 3 /* Loading PG buf */
-#define PMU_STATE_LOADING_ZBC 4 /* Loading ZBC buf */
-#define PMU_STATE_STARTED 5 /* Fully unitialized */
+#define PMU_STATE_STARTING 1 /* PMU is on, but not booted */
+#define PMU_STATE_ELPG_BOOTING 2 /* PMU is booting */
+#define PMU_STATE_ELPG_BOOTED 3 /* ELPG is initialized */
+#define PMU_STATE_LOADING_PG_BUF 4 /* Loading PG buf */
+#define PMU_STATE_LOADING_ZBC 5 /* Loading ZBC buf */
+#define PMU_STATE_STARTED 6 /* Fully unitialized */
+
struct pmu_gk20a {