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

Commit 17112237 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

sched: walt: Fix thermal un-mitigation bug



do_thermal_cap attempted to optimize away unnecessary division
when multiple updates came in with 'thermal_max_freq' set to
the maximum possible frequency. However this introduced a bug
that prevented resetting capacity to the max possible value when
thermal finally allowed the maximum frequency to be set. Fix it.

Change-Id: I49b6ca55cf8226358678c6d313e130b15dc2242d
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent 9c9a0530
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -2833,15 +2833,12 @@ unsigned long do_thermal_cap(int cpu, unsigned long thermal_max_freq)
		rcu_read_unlock();
	}

	if (cpu_max_table_freq[cpu] &&
	    unlikely(thermal_max_freq && thermal_max_freq
		!= cpu_max_table_freq[cpu])) {
	if (cpu_max_table_freq[cpu])
		return div64_ul(thermal_max_freq * max_cap[cpu],
				cpu_max_table_freq[cpu]);
	} else {
	else
		return rq->cpu_capacity_orig;
}
}

static DEFINE_SPINLOCK(cpu_freq_min_max_lock);
void sched_update_cpu_freq_min_max(const cpumask_t *cpus, u32 fmin, u32 fmax)