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

Commit 1160fcb5 authored by Daniel Kurtz's avatar Daniel Kurtz Committed by Amit Pundir
Browse files

cpufreq: interactive: only apply interactive boost when enabled

Only apply the interactive boost when the interactive governor is
enabled.  This seems like the right thing to do.

This was originally reviewed on
	https://chromium-review.googlesource.com/273501



Change-Id: I5f4a7320683eada099f9a4253e3d6b0f03057fe8
Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@google.com>
parent 78e6913a
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -600,9 +600,20 @@ static void cpufreq_interactive_boost(struct cpufreq_interactive_tunables *tunab

	for_each_online_cpu(i) {
		pcpu = &per_cpu(cpuinfo, i);
		if (tunables != pcpu->policy->governor_data)

		if (!down_read_trylock(&pcpu->enable_sem))
			continue;

		if (!pcpu->governor_enabled) {
			up_read(&pcpu->enable_sem);
			continue;
		}

		if (tunables != pcpu->policy->governor_data) {
			up_read(&pcpu->enable_sem);
			continue;
		}

		spin_lock_irqsave(&pcpu->target_freq_lock, flags[1]);
		if (pcpu->target_freq < tunables->hispeed_freq) {
			pcpu->target_freq = tunables->hispeed_freq;
@@ -612,6 +623,8 @@ static void cpufreq_interactive_boost(struct cpufreq_interactive_tunables *tunab
			anyboost = 1;
		}
		spin_unlock_irqrestore(&pcpu->target_freq_lock, flags[1]);

		up_read(&pcpu->enable_sem);
	}

	spin_unlock_irqrestore(&speedchange_cpumask_lock, flags[0]);