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

Commit 94137b29 authored by Junjie Wu's avatar Junjie Wu Committed by Stephen Boyd
Browse files

cpufreq: interactive: Use wake_up_process_no_notif to wake up tasks



Scheduler could send a notification to governor each time a task wakes
up. If governor wakes up another task as a response to such a
notification, it could result in endless recursive notifications.

Use wake_up_process_no_notif to ensure scheduler won't send another
notification for speedchange task woken up by the governor.

Change-Id: I697affcbdf79e2ad0cfe843eb880d304960682f4
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 62b27ec2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ static void cpufreq_interactive_timer(unsigned long data)
	spin_lock_irqsave(&speedchange_cpumask_lock, flags);
	cpumask_set_cpu(max_cpu, &speedchange_cpumask);
	spin_unlock_irqrestore(&speedchange_cpumask_lock, flags);
	wake_up_process(speedchange_task);
	wake_up_process_no_notif(speedchange_task);

rearm:
	if (!timer_pending(&ppol->policy_timer))
@@ -764,7 +764,7 @@ static void cpufreq_interactive_boost(struct cpufreq_interactive_tunables *tunab
	spin_unlock_irqrestore(&speedchange_cpumask_lock, flags[0]);

	if (anyboost)
		wake_up_process(speedchange_task);
		wake_up_process_no_notif(speedchange_task);
}

static int load_change_callback(struct notifier_block *nb, unsigned long val,
@@ -1791,7 +1791,7 @@ static int __init cpufreq_interactive_init(void)
	get_task_struct(speedchange_task);

	/* NB: wake up so the thread does not look hung to the freezer */
	wake_up_process(speedchange_task);
	wake_up_process_no_notif(speedchange_task);

	return cpufreq_register_governor(&cpufreq_gov_interactive);
}