Skip to content

Commit

Permalink
cpufreq: interactive: keep freezer happy when not current governor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sam Leffler authored and arco committed Jul 25, 2012
1 parent 6bb6ac2 commit 5e2d035
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/cpufreq/cpufreq_interactive.c
Expand Up @@ -953,6 +953,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))
Expand All @@ -968,14 +972,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:
Expand Down

0 comments on commit 5e2d035

Please sign in to comment.