summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra_simon.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2014-03-15 20:53:57 -0700
committerYu-Huan Hsu <yhsu@nvidia.com>2014-03-17 12:32:24 -0700
commitaec4999e98980121734752f6f15c993455acff98 (patch)
treef519a6b868a0c0d7281e497d93b0fa4bb279d423 /arch/arm/mach-tegra/tegra_simon.c
parent18410fc7404225aa4f578fb7741b7f8080dfa13d (diff)
ARM: tegra: power: Allow SiMon high grade once
Updated SiMon grading policy so that lowering high (non-zero) grade back to zero automatically stops grading completely. Bug 1343366 Change-Id: I1d94b071eba7bfdd4371958d018a702bf58b8cb5 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/382336 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra_simon.c')
-rw-r--r--arch/arm/mach-tegra/tegra_simon.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra_simon.c b/arch/arm/mach-tegra/tegra_simon.c
index 7a8a2d4af84e..b767de8d1691 100644
--- a/arch/arm/mach-tegra/tegra_simon.c
+++ b/arch/arm/mach-tegra/tegra_simon.c
@@ -79,6 +79,9 @@ static int tegra_simon_gpu_grading_cb(
if (!(event & REGULATOR_EVENT_OUT_POSTCHANGE))
return NOTIFY_DONE;
+ if (grader->stop_grading)
+ return NOTIFY_OK;
+
mv = (mv > 0) ? mv / 1000 : mv;
if ((mv <= 0) || (mv > grader->desc->grading_mv_limit))
return NOTIFY_OK;
@@ -106,6 +109,9 @@ static int tegra_simon_gpu_grading_cb(
grader->last_grading = now;
if (grader->grade != grade) {
+ /* once return to low grade, stay until next boot */
+ if (grade == 0)
+ grader->stop_grading = true;
set_mb(grader->grade, grade);
schedule_work(&grader->grade_update_work);
}
@@ -166,6 +172,9 @@ static int tegra_simon_cpu_grading_cb(
int mv;
int grade = 0;
+ if (grader->stop_grading)
+ return NOTIFY_OK;
+
if (is_lp_cluster() || (rate > grader->desc->garding_rate_limit) ||
!tegra_dvfs_rail_is_dfll_mode(tegra_cpu_rail))
return NOTIFY_OK;
@@ -209,6 +218,9 @@ static int tegra_simon_cpu_grading_cb(
grader->last_grading = now;
if (grader->grade != grade) {
+ /* once return to low grade, stay until next boot */
+ if (grade == 0)
+ grader->stop_grading = true;
set_mb(grader->grade, grade);
schedule_work(&grader->grade_update_work);
}
@@ -375,6 +387,10 @@ static int __init simon_debugfs_init_domain(struct dentry *dir,
(void *)grader, &grade_fops))
return -ENOMEM;
+ if (!debugfs_create_bool("grading_stopped", S_IRUGO, d,
+ (u32 *)&grader->stop_grading))
+ return -ENOMEM;
+
return 0;
}