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

Commit 67dd6bf3 authored by Todd Poynor's avatar Todd Poynor Committed by Ruchi Kandoi
Browse files

cpufreq: interactive: don't handle transition notification if not enabled



If multiple governors are in use then avoid processing frequency transition
notifications for CPUs on which the interactive governor is not enabled.

Change-Id: Ibd75255b921d887501a64774a8c4f62302f2d4e4
Reported-by: default avatarFrancisco Franco <francisco.franco@cloudcar.com>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
parent 221eb7f5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -552,6 +552,12 @@ static int cpufreq_interactive_notifier(

	if (val == CPUFREQ_POSTCHANGE) {
		pcpu = &per_cpu(cpuinfo, freq->cpu);
		if (!down_read_trylock(&pcpu->enable_sem))
			return 0;
		if (!pcpu->governor_enabled) {
			up_read(&pcpu->enable_sem);
			return 0;
		}

		for_each_cpu(cpu, pcpu->policy->cpus) {
			struct cpufreq_interactive_cpuinfo *pjcpu =
@@ -560,8 +566,9 @@ static int cpufreq_interactive_notifier(
			update_load(cpu);
			spin_unlock(&pjcpu->load_lock);
		}
	}

		up_read(&pcpu->enable_sem);
	}
	return 0;
}