aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched/cpufreq_schedutil.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index f165ba0f0766..42a220e78f00 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -390,15 +390,12 @@ static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy)
390 return NULL; 390 return NULL;
391 391
392 sg_policy->policy = policy; 392 sg_policy->policy = policy;
393 init_irq_work(&sg_policy->irq_work, sugov_irq_work);
394 mutex_init(&sg_policy->work_lock);
395 raw_spin_lock_init(&sg_policy->update_lock); 393 raw_spin_lock_init(&sg_policy->update_lock);
396 return sg_policy; 394 return sg_policy;
397} 395}
398 396
399static void sugov_policy_free(struct sugov_policy *sg_policy) 397static void sugov_policy_free(struct sugov_policy *sg_policy)
400{ 398{
401 mutex_destroy(&sg_policy->work_lock);
402 kfree(sg_policy); 399 kfree(sg_policy);
403} 400}
404 401
@@ -432,6 +429,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
432 429
433 sg_policy->thread = thread; 430 sg_policy->thread = thread;
434 kthread_bind_mask(thread, policy->related_cpus); 431 kthread_bind_mask(thread, policy->related_cpus);
432 init_irq_work(&sg_policy->irq_work, sugov_irq_work);
433 mutex_init(&sg_policy->work_lock);
434
435 wake_up_process(thread); 435 wake_up_process(thread);
436 436
437 return 0; 437 return 0;
@@ -445,6 +445,7 @@ static void sugov_kthread_stop(struct sugov_policy *sg_policy)
445 445
446 kthread_flush_worker(&sg_policy->worker); 446 kthread_flush_worker(&sg_policy->worker);
447 kthread_stop(sg_policy->thread); 447 kthread_stop(sg_policy->thread);
448 mutex_destroy(&sg_policy->work_lock);
448} 449}
449 450
450static struct sugov_tunables *sugov_tunables_alloc(struct sugov_policy *sg_policy) 451static struct sugov_tunables *sugov_tunables_alloc(struct sugov_policy *sg_policy)
@@ -611,8 +612,10 @@ static void sugov_stop(struct cpufreq_policy *policy)
611 612
612 synchronize_sched(); 613 synchronize_sched();
613 614
614 irq_work_sync(&sg_policy->irq_work); 615 if (!policy->fast_switch_enabled) {
615 kthread_cancel_work_sync(&sg_policy->work); 616 irq_work_sync(&sg_policy->irq_work);
617 kthread_cancel_work_sync(&sg_policy->work);
618 }
616} 619}
617 620
618static void sugov_limits(struct cpufreq_policy *policy) 621static void sugov_limits(struct cpufreq_policy *policy)