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

Commit 841f4e8a authored by Srinivas Rao L's avatar Srinivas Rao L
Browse files

cpuidle: lpm-levels: Fix RIMPS timer programming



For the hotplug case there is chance that RIMPS timer being
programmed even if the last core in the domain is going down.
Consider online state of cpu's to fix this.

Change-Id: Id2bdd99c0e93ea67d5c9a1ae77fa033f004809c9
Signed-off-by: default avatarSrinivas Rao L <lsrao@codeaurora.org>
parent 49eed0fd
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -251,8 +251,13 @@ static uint32_t get_next_event(struct lpm_cpu *cpu)
{
{
	ktime_t next_event = KTIME_MAX;
	ktime_t next_event = KTIME_MAX;
	unsigned int next_cpu;
	unsigned int next_cpu;
	struct cpumask cpu_lpm_mask;

	cpumask_and(&cpu_lpm_mask, &cpu->related_cpus, cpu_online_mask);
	if (cpumask_empty(&cpu_lpm_mask))
		return 0;


	for_each_cpu(next_cpu, &cpu->related_cpus) {
	for_each_cpu(next_cpu, &cpu_lpm_mask) {
		ktime_t next_event_c = per_cpu(cpu_lpm, next_cpu)->next_hrtimer;
		ktime_t next_event_c = per_cpu(cpu_lpm, next_cpu)->next_hrtimer;


		if (next_event > next_event_c)
		if (next_event > next_event_c)