summaryrefslogtreecommitdiff
path: root/drivers/cpuquiet
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2013-02-12 17:51:26 +0200
committerSimone Willett <swillett@nvidia.com>2013-04-12 18:09:45 -0700
commit31511cff248865c46eead9665347de193e9e5042 (patch)
tree5610ef7a0843e84779d6e1b320519a5765cdf0f5 /drivers/cpuquiet
parentd1cec7cbb4b499080e2e72b60aaa77ad4aad3105 (diff)
ARM: tegra: cpuquiet: make userspace governor actions synchronous
Userspace expects changes to happen synchronously. Implement this by waiting with a (configureable) timeout for the action to happen. Bug 1220065 Change-Id: I81301719707e4baf2b3aea62c38fc771ffe1205d Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> (cherry picked from commit 9de8f56142e64ebf388b5427ef7fd142078dfa87) Reviewed-on: http://git-master/r/#change,200013 Reviewed-on: http://git-master/r/215934 GVS: Gerrit_Virtual_Submit Reviewed-by: Matt Wagner <mwagner@nvidia.com> Tested-by: Matt Wagner <mwagner@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet')
-rw-r--r--drivers/cpuquiet/driver.c8
-rw-r--r--drivers/cpuquiet/governors/balanced.c4
-rw-r--r--drivers/cpuquiet/governors/runnable_threads.c4
-rw-r--r--drivers/cpuquiet/governors/userspace.c8
4 files changed, 13 insertions, 11 deletions
diff --git a/drivers/cpuquiet/driver.c b/drivers/cpuquiet/driver.c
index fc83fa8cd022..fb9912b86e5e 100644
--- a/drivers/cpuquiet/driver.c
+++ b/drivers/cpuquiet/driver.c
@@ -106,12 +106,12 @@ static struct kobj_type ktype_cpu_stats = {
};
#endif
-int cpuquiet_quiesence_cpu(unsigned int cpunumber)
+int cpuquiet_quiesence_cpu(unsigned int cpunumber, bool sync)
{
int err = -EPERM;
if (cpuquiet_curr_driver && cpuquiet_curr_driver->quiesence_cpu)
- err = cpuquiet_curr_driver->quiesence_cpu(cpunumber);
+ err = cpuquiet_curr_driver->quiesence_cpu(cpunumber, sync);
#ifdef CONFIG_CPUQUIET_STATS
if (!err)
@@ -122,12 +122,12 @@ int cpuquiet_quiesence_cpu(unsigned int cpunumber)
}
EXPORT_SYMBOL(cpuquiet_quiesence_cpu);
-int cpuquiet_wake_cpu(unsigned int cpunumber)
+int cpuquiet_wake_cpu(unsigned int cpunumber, bool sync)
{
int err = -EPERM;
if (cpuquiet_curr_driver && cpuquiet_curr_driver->wake_cpu)
- err = cpuquiet_curr_driver->wake_cpu(cpunumber);
+ err = cpuquiet_curr_driver->wake_cpu(cpunumber, sync);
#ifdef CONFIG_CPUQUIET_STATS
if (!err)
diff --git a/drivers/cpuquiet/governors/balanced.c b/drivers/cpuquiet/governors/balanced.c
index f187206ef1c4..794ef1e7e24c 100644
--- a/drivers/cpuquiet/governors/balanced.c
+++ b/drivers/cpuquiet/governors/balanced.c
@@ -341,9 +341,9 @@ static void balanced_work_func(struct work_struct *work)
if (cpu < nr_cpu_ids) {
last_change_time = now;
if (up)
- cpuquiet_wake_cpu(cpu);
+ cpuquiet_wake_cpu(cpu, false);
else
- cpuquiet_quiesence_cpu(cpu);
+ cpuquiet_quiesence_cpu(cpu, false);
}
}
diff --git a/drivers/cpuquiet/governors/runnable_threads.c b/drivers/cpuquiet/governors/runnable_threads.c
index 676cde5bdec6..cdac85ed8d3c 100644
--- a/drivers/cpuquiet/governors/runnable_threads.c
+++ b/drivers/cpuquiet/governors/runnable_threads.c
@@ -190,11 +190,11 @@ static void runnables_work_func(struct work_struct *work)
if (action > 0) {
cpu = cpumask_next_zero(0, cpu_online_mask);
if (cpu < nr_cpu_ids)
- cpuquiet_wake_cpu(cpu);
+ cpuquiet_wake_cpu(cpu, false);
} else if (action < 0) {
cpu = get_lightest_loaded_cpu_n();
if (cpu < nr_cpu_ids)
- cpuquiet_quiesence_cpu(cpu);
+ cpuquiet_quiesence_cpu(cpu, false);
}
}
diff --git a/drivers/cpuquiet/governors/userspace.c b/drivers/cpuquiet/governors/userspace.c
index 664594d68d8c..12a3d86228ed 100644
--- a/drivers/cpuquiet/governors/userspace.c
+++ b/drivers/cpuquiet/governors/userspace.c
@@ -25,14 +25,16 @@ static DEFINE_MUTEX(userspace_mutex);
static int governor_set(unsigned int cpu, bool active)
{
+ int err;
+
mutex_lock(&userspace_mutex);
if (active)
- cpuquiet_wake_cpu(cpu);
+ err = cpuquiet_wake_cpu(cpu, true);
else
- cpuquiet_quiesence_cpu(cpu);
+ err = cpuquiet_quiesence_cpu(cpu, true);
mutex_unlock(&userspace_mutex);
- return 0;
+ return err;
}
struct cpuquiet_governor userspace_governor = {