FIXUP: sched: scheduler-driven cpu frequency selection

Two fixups that have been reported on LKML. The next version of
scheduler-driver cpu frequency selection patch set should include
these fixes and we can drop this patch then.

Signed-off-by: Ricky Liang <jcliang@chromium.org>

Change-Id: Ia2f8b5c0dd5dac06580256eeb4b259929688af68
This commit is contained in:
Ricky Liang 2016-02-02 01:12:06 +08:00 committed by John Stultz
parent 2a4445395f
commit 34828bd3e7

View file

@ -131,6 +131,8 @@ static int cpufreq_sched_thread(void *data)
new_request = gd->requested_freq;
if (new_request == last_request) {
set_current_state(TASK_INTERRUPTIBLE);
if (kthread_should_stop())
break;
schedule();
} else {
/*
@ -293,6 +295,7 @@ static int cpufreq_sched_policy_init(struct cpufreq_policy *policy)
goto err;
}
policy->governor_data = gd;
if (cpufreq_driver_is_slow()) {
cpufreq_driver_slow = true;
gd->task = kthread_create(cpufreq_sched_thread, policy,
@ -309,12 +312,12 @@ static int cpufreq_sched_policy_init(struct cpufreq_policy *policy)
init_irq_work(&gd->irq_work, cpufreq_sched_irq_work);
}
policy->governor_data = gd;
set_sched_freq();
return 0;
err:
policy->governor_data = NULL;
kfree(gd);
return -ENOMEM;
}