summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Leffler <sleffler@chromium.org>2012-06-27 12:55:56 -0700
committerJohn Stultz <john.stultz@linaro.org>2012-10-11 14:40:35 -0400
commitd8d7c62397951f2bd88cf4b9b82038d83bc44c88 (patch)
treec49f6fb8fc315d49a50f36e48def9a8e16119e1c
parentca637854a8db8683b73c879b53a1dc7c304bf3ca (diff)
downloadlinux-topics-d8d7c62397951f2bd88cf4b9b82038d83bc44c88.tar.gz
cpufreq: interactive: keep freezer happy when not current governor
Fix a problem where the hung task mechanism was deeming the interactive clock boost thread as hung. This was because the thread is created at module init but never run/woken up until needed. If the governor is not being used this can be forever. To workaround this explicitly wake up the thread once all the necessary data structures are initialized. The latter required some minor code shuffle. Signed-off-by: Sam Leffler <sleffler@chromium.org> Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe
-rw-r--r--drivers/cpufreq/cpufreq_interactive.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 86bff9f0d58..813895ab49e 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -952,6 +952,10 @@ static int __init cpufreq_interactive_init(void)
pcpu->cpu_timer.data = i;
}
+ spin_lock_init(&up_cpumask_lock);
+ spin_lock_init(&down_cpumask_lock);
+ mutex_init(&set_speed_lock);
+
up_task = kthread_create(cpufreq_interactive_up_task, NULL,
"kinteractiveup");
if (IS_ERR(up_task))
@@ -967,14 +971,12 @@ static int __init cpufreq_interactive_init(void)
if (!down_wq)
goto err_freeuptask;
- INIT_WORK(&freq_scale_down_work,
- cpufreq_interactive_freq_down);
+ INIT_WORK(&freq_scale_down_work, cpufreq_interactive_freq_down);
+ INIT_WORK(&inputopen.inputopen_work, cpufreq_interactive_input_open);
- spin_lock_init(&up_cpumask_lock);
- spin_lock_init(&down_cpumask_lock);
- mutex_init(&set_speed_lock);
+ /* NB: wake up so the thread does not look hung to the freezer */
+ wake_up_process(up_task);
- INIT_WORK(&inputopen.inputopen_work, cpufreq_interactive_input_open);
return cpufreq_register_governor(&cpufreq_gov_interactive);
err_freeuptask: