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

Commit a7692d8d authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

cpuidle: lpm-levels: Report correct C-states to the scheduler



The scheduler currently receives the low power mode level that a CPU
is about to enter whereby 0 indicates the shallowest sleep state and
higher numbers indicate deeper sleep states. The scheduler, however,
operates on the notion of C-states whereby 0 indicates an active state
and a higher numbers indicate different sleep states. Due to this
mismatch the scheduler is unable to distinguish between an active CPU
and a CPU in the shallowest sleep state. Fix this by translating the
low power mode level to the appropriate C-state before communicating
it to the scheduler.

Change-Id: I60d985626cb799d436172c00861f05538c2b382a
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent c5bc590f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	}

	pwr_params = &cluster->cpu->levels[idx].pwr;
	sched_set_cpu_cstate(smp_processor_id(), idx,
	sched_set_cpu_cstate(smp_processor_id(), idx + 1,
		pwr_params->energy_overhead, pwr_params->latency_us);

	cpu_prepare(cluster, idx, true);