Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57a7407 authored by Ricky Liang's avatar Ricky Liang Committed by Dmitry Shmidt
Browse files

ANDROID: 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: default avatarRicky Liang <jcliang@chromium.org>

Change-Id: Ia2f8b5c0dd5dac06580256eeb4b259929688af68
Signed-off-by: default avatarAndres Oportus <andresoportus@google.com>
parent 345eb978
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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 {
			/*
@@ -290,6 +292,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,
@@ -306,12 +309,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;
}