diff options
author | Archana Sathyakumar <asathyak@codeaurora.org> | 2016-06-24 16:19:37 -0600 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-28 17:02:04 -0700 |
commit | 226509c1ee0e257d2646fd4aec9a594f4c31dab0 (patch) | |
tree | 10cd2c492afa5e88ae878a15196cc815eacae831 /drivers/cpuidle | |
parent | b378543680c2a1f52fc91e0a10921184ec2a842c (diff) |
lpm-levels: Fix cpu idle trace and stats event
In the event that the cpu needs to be rescheduled for another task
before it enters psci sleep, the stats and trace exit events are
considered without the enter events. Fix this issue by moving enter
events before the cpu gets scheduled.
Change-Id: I8e477c434d218960b48aab4e61cacf99476b607f
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/lpm-levels.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c index 956f435c08be..3f8a3927ff92 100644 --- a/drivers/cpuidle/lpm-levels.c +++ b/drivers/cpuidle/lpm-levels.c @@ -1026,12 +1026,13 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev, cpu_prepare(cluster, idx, true); cluster_prepare(cluster, cpumask, idx, true, ktime_to_ns(ktime_get())); + trace_cpu_idle_enter(idx); + lpm_stats_cpu_enter(idx, start_time); + if (need_resched() || (idx < 0)) goto exit; BUG_ON(!use_psci); - trace_cpu_idle_enter(idx); - lpm_stats_cpu_enter(idx, start_time); success = psci_enter_sleep(cluster, idx, true); exit: |