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

Commit ba83fb89 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

lpm-levels: Move cpuidle tracepoints within lpm_levels



Currently the cpuidle driver considers the mode selected by menu
governor for trace events. lpm_levels recalculates the cpu and system
modes within the enter_sleep function and overwrites the menu governor
mode selection with its decision. Due to this other modules that are
dependent on these tracepoints collect incorrect low power mode
information.

Move the tracepoint within lpm_levels such that the mode selected within
lpm-levels is correctly reported and traced.

Change-Id: I9059a107da21ceebe11ae83427d36a28cf3f1a8e
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 53a5295c
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <linux/module.h>
#include <trace/events/power.h>

#include "cpuidle.h"

@@ -144,15 +143,6 @@ int cpuidle_idle_call(void)
		return 0;
	}

	trace_cpu_idle_rcuidle(next_state, dev->cpu);

	if (need_resched()) {
		dev->last_residency = 0;
		local_irq_enable();
		entered_state = next_state;
		goto exit;
	}

	if (drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP)
		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
				   &dev->cpu);
@@ -167,9 +157,6 @@ int cpuidle_idle_call(void)
		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
				   &dev->cpu);

exit:
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);

	/* give the governor an opportunity to reflect on the outcome */
	if (cpuidle_curr_governor->reflect)
		cpuidle_curr_governor->reflect(dev, entered_state);
+10 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#include <asm/arch_timer.h>
#include <asm/cacheflush.h>
#include "lpm-levels.h"

#include <trace/events/power.h>
#define CREATE_TRACE_POINTS
#include <trace/events/trace_msm_low_power.h>

@@ -656,6 +656,13 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
		return -EPERM;
	}

	trace_cpu_idle_rcuidle(idx, dev->cpu);

	if (need_resched()) {
		dev->last_residency = 0;
		goto exit;
	}

	pwr_params = &cluster->cpu->levels[idx].pwr;
	sched_set_cpu_cstate(smp_processor_id(), idx,
		pwr_params->energy_overhead, pwr_params->latency_us);
@@ -677,7 +684,9 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
	do_div(time, 1000);
	dev->last_residency = (int)time;

exit:
	local_irq_enable();
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
	return idx;
}