summaryrefslogtreecommitdiff
path: root/drivers/cpuquiet/governors
diff options
context:
space:
mode:
authorSai Charan Gurrappadi <sgurrappadi@nvidia.com>2012-07-25 08:41:53 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:33:46 -0700
commit37dae01f85a98a5efa7e347438de0c7a13e4536d (patch)
treeb00463cc15d9e6e34df41a9fddd4883d124dc6c4 /drivers/cpuquiet/governors
parent4976b21506b194f0ab0ebfc013b33d75a619592a (diff)
cpuquiet: Add notifiers for the runnables governor
The governor stops sampling whenever the device is busy and starts its sampling loop when the device is free. Change-Id: Ifdae4a84e56c2734be48e49f6112b537602a02da Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com> Reviewed-on: http://git-master/r/124680 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet/governors')
-rw-r--r--drivers/cpuquiet/governors/runnable_threads.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/cpuquiet/governors/runnable_threads.c b/drivers/cpuquiet/governors/runnable_threads.c
index a44abe9b25f2..44cf308befcf 100644
--- a/drivers/cpuquiet/governors/runnable_threads.c
+++ b/drivers/cpuquiet/governors/runnable_threads.c
@@ -186,6 +186,22 @@ static int runnables_sysfs(void)
return err;
}
+static void runnables_device_busy(void)
+{
+ if (runnables_state != DISABLED) {
+ runnables_state = DISABLED;
+ cancel_delayed_work_sync(&runnables_work);
+ }
+}
+
+static void runnables_device_free(void)
+{
+ if (runnables_state == DISABLED) {
+ runnables_state = IDLE;
+ runnables_work_func(NULL);
+ }
+}
+
static void runnables_stop(void)
{
runnables_state = DISABLED;
@@ -228,6 +244,8 @@ static int runnables_start(void)
struct cpuquiet_governor runnables_governor = {
.name = "runnable",
.start = runnables_start,
+ .device_free_notification = runnables_device_free,
+ .device_busy_notification = runnables_device_busy,
.stop = runnables_stop,
.owner = THIS_MODULE,
};