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

Commit 3b2e3dcd authored by Maulik Shah's avatar Maulik Shah Committed by Gerrit - the friendly Code Review server
Browse files

lpm-levels: Return from idle enter for negative mode



Return immediately from idle enter if there is no mode
selected. Log idle exit as failure to enter LPM in the
events that cpu needs to be rescheduled for another task.

Change-Id: I25a444682a8f8c9060f426c03e2f183f86d2fa3a
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent ded703d6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1542,11 +1542,14 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
		struct cpuidle_driver *drv, int idx)
{
	struct lpm_cluster *cluster = per_cpu(cpu_cluster, dev->cpu);
	bool success = true;
	bool success = false;
	const struct cpumask *cpumask = get_cpu_mask(dev->cpu);
	int64_t start_time = ktime_to_ns(ktime_get()), end_time;
	struct power_params *pwr_params;

	if (idx < 0)
		return -EINVAL;

	pwr_params = &cluster->cpu->levels[idx].pwr;
	sched_set_cpu_cstate(smp_processor_id(), idx + 1,
		pwr_params->energy_overhead, pwr_params->latency_us);
@@ -1559,7 +1562,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	trace_cpu_idle_enter(idx);
	lpm_stats_cpu_enter(idx, start_time);

	if (need_resched() || (idx < 0))
	if (need_resched())
		goto exit;

	BUG_ON(!use_psci);