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

Commit 36b30fbb authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: Fix sched_cpu_legacy_freq() implementation



arch_scale_freq_capacity() returns the current CPU capacity scaled
to the maximum possible frequency (policy->cpuinfo.max_freq) but not
maximum frequency (policy->max) as per the current cpufreq policy. So
use the maximum possible frequency while deriving the current frequency
in sched_cpu_legacy_freq().

Change-Id: If4fd1ec26c5beaf1982f61c8be37dc064c8b7828
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent be6243a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ static inline unsigned int sched_cpu_legacy_freq(int cpu)
{
	unsigned long curr_cap = arch_scale_freq_capacity(NULL, cpu);

	return (curr_cap * (u64) cpu_rq(cpu)->cluster->max_freq) >>
	return (curr_cap * (u64) cpu_rq(cpu)->cluster->max_possible_freq) >>
		SCHED_CAPACITY_SHIFT;
}