diff --git a/drivers/cpufreq/cpu-boost.c b/drivers/cpufreq/cpu-boost.c index f9ec03a92bdb..445b1798aa4a 100644 --- a/drivers/cpufreq/cpu-boost.c +++ b/drivers/cpufreq/cpu-boost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -164,9 +165,15 @@ static int boost_mig_sync_thread(void *data) s->boost_min = src_policy.cur; /* Force policy re-evaluation to trigger adjust notifier. */ - cpufreq_update_policy(dest_cpu); - queue_delayed_work_on(s->cpu, cpu_boost_wq, - &s->boost_rem, msecs_to_jiffies(boost_ms)); + get_online_cpus(); + if (cpu_online(dest_cpu)) { + cpufreq_update_policy(dest_cpu); + queue_delayed_work_on(dest_cpu, cpu_boost_wq, + &s->boost_rem, msecs_to_jiffies(boost_ms)); + } else { + s->boost_min = 0; + } + put_online_cpus(); } return 0; @@ -205,6 +212,7 @@ static void do_input_boost(struct work_struct *work) struct cpu_sync *i_sync_info; struct cpufreq_policy policy; + get_online_cpus(); for_each_online_cpu(i) { i_sync_info = &per_cpu(sync_info, i); @@ -221,6 +229,7 @@ static void do_input_boost(struct work_struct *work) &i_sync_info->input_boost_rem, msecs_to_jiffies(input_boost_ms)); } + put_online_cpus(); } static void cpuboost_input_event(struct input_handle *handle,