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

Commit ad5c6487 authored by Maria Yu's avatar Maria Yu Committed by Gerrit - the friendly Code Review server
Browse files

sched/walt: Check if necessary for sched_boost modify



Check if necessary to do exit and next_boost enter
oprations instead of doing it regardlessly.
Core control boost refcounts has been wrong if doing
current sched_boost exit and next_boost enter by mistake.

Change-Id: Ie40ebf0be0e1b99291d07d160ebef5964d44ba16
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
Signed-off-by: default avatarTengfei Fan <tengfeif@codeaurora.org>
parent 53efbbd8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ static int sched_effective_boost(void)
static void sched_boost_disable(int type)
{
	struct sched_boost_data *sb = &sched_boosts[type];
	int next_boost;
	int next_boost, prev_boost = sched_boost_type;

	if (sb->refcount <= 0)
		return;
@@ -192,14 +192,15 @@ static void sched_boost_disable(int type)
	if (sb->refcount)
		return;

	next_boost = sched_effective_boost();
	if (next_boost == prev_boost)
		return;
	/*
	 * This boost's refcount becomes zero, so it must
	 * be disabled. Disable it first and then apply
	 * the next boost.
	 */
	sb->exit();

	next_boost = sched_effective_boost();
	sched_boosts[next_boost].enter();
}