diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 235a340e81f..85c28d4f8a6 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -80,6 +80,8 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ */ static DEFINE_MUTEX(dbs_mutex); +static struct workqueue_struct *dbs_wq; + static struct dbs_tuners { unsigned int sampling_rate; unsigned int sampling_down_factor; @@ -455,7 +457,7 @@ static void do_dbs_timer(struct work_struct *work) dbs_check_cpu(dbs_info); - schedule_delayed_work_on(cpu, &dbs_info->work, delay); + queue_delayed_work_on(cpu, dbs_wq, &dbs_info->work, delay); mutex_unlock(&dbs_info->timer_mutex); } @@ -467,7 +469,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) dbs_info->enable = 1; INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); - schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay); + queue_delayed_work_on(dbs_info->cpu, dbs_wq, &dbs_info->work, delay); } static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) @@ -602,12 +604,19 @@ struct cpufreq_governor cpufreq_gov_conservative = { static int __init cpufreq_gov_dbs_init(void) { + dbs_wq = alloc_workqueue("conservative_dbs_wq", WQ_HIGHPRI, 0); + if (!dbs_wq) { + printk(KERN_ERR "Failed to create conservative_dbs_wq workqueue\n"); + return -EFAULT; + } + return cpufreq_register_governor(&cpufreq_gov_conservative); } static void __exit cpufreq_gov_dbs_exit(void) { cpufreq_unregister_governor(&cpufreq_gov_conservative); + destroy_workqueue(dbs_wq); } diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 7b01432c906..79f7174348f 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -116,7 +116,7 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ */ static DEFINE_MUTEX(dbs_mutex); -static struct workqueue_struct *input_wq; +static struct workqueue_struct *dbs_wq; struct dbs_work_struct { struct work_struct work; @@ -376,8 +376,8 @@ static void update_sampling_rate(unsigned int new_rate) cancel_delayed_work_sync(&dbs_info->work); mutex_lock(&dbs_info->timer_mutex); - schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, - usecs_to_jiffies(new_rate)); + queue_delayed_work_on(dbs_info->cpu, dbs_wq, + &dbs_info->work, usecs_to_jiffies(new_rate)); } mutex_unlock(&dbs_info->timer_mutex); @@ -941,7 +941,7 @@ static void do_dbs_timer(struct work_struct *work) dbs_info->freq_lo, CPUFREQ_RELATION_H); delay = dbs_info->freq_lo_jiffies; } - schedule_delayed_work_on(cpu, &dbs_info->work, delay); + queue_delayed_work_on(cpu, dbs_wq, &dbs_info->work, delay); mutex_unlock(&dbs_info->timer_mutex); } @@ -955,7 +955,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) dbs_info->sample_type = DBS_NORMAL_SAMPLE; INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); - schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay); + queue_delayed_work_on(dbs_info->cpu, dbs_wq, &dbs_info->work, delay); } static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) @@ -1036,7 +1036,7 @@ static int dbs_migration_notify(struct notifier_block *nb, &per_cpu(dbs_sync_work, target_cpu); sync_work->src_cpu = (unsigned int)arg; - queue_work_on(target_cpu, input_wq, + queue_work_on(target_cpu, dbs_wq, &per_cpu(dbs_sync_work, target_cpu).work); return NOTIFY_OK; @@ -1127,7 +1127,7 @@ static void dbs_input_event(struct input_handle *handle, unsigned int type, } for_each_online_cpu(i) - queue_work_on(i, input_wq, &per_cpu(dbs_refresh_work, i).work); + queue_work_on(i, dbs_wq, &per_cpu(dbs_refresh_work, i).work); } static int dbs_input_connect(struct input_handler *handler, @@ -1325,9 +1325,9 @@ static int __init cpufreq_gov_dbs_init(void) MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10); } - input_wq = create_workqueue("iewq"); - if (!input_wq) { - printk(KERN_ERR "Failed to create iewq workqueue\n"); + dbs_wq = alloc_workqueue("ondemand_dbs_wq", WQ_HIGHPRI, 0); + if (!dbs_wq) { + printk(KERN_ERR "Failed to create ondemand_dbs_wq workqueue\n"); return -EFAULT; } for_each_possible_cpu(i) { @@ -1361,7 +1361,7 @@ static void __exit cpufreq_gov_dbs_exit(void) &per_cpu(od_cpu_dbs_info, i); mutex_destroy(&this_dbs_info->timer_mutex); } - destroy_workqueue(input_wq); + destroy_workqueue(dbs_wq); }