msm: pm2: Use PER CPU variable to log the idle stats
Replace local static varaible with per cpu static varaible
to log the individual cores idle statistics information
correctly.
Change-Id: If6a9ccd66c2a9ff6bb748134814fb6b7bdb4d257
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
diff --git a/arch/arm/mach-msm/pm2.c b/arch/arm/mach-msm/pm2.c
index 70b273b..7903eab 100644
--- a/arch/arm/mach-msm/pm2.c
+++ b/arch/arm/mach-msm/pm2.c
@@ -1506,7 +1506,7 @@
#ifdef CONFIG_MSM_IDLE_STATS
int64_t t1;
- static int64_t t2;
+ static DEFINE_PER_CPU(int64_t, t2);
int exit_stat;
#endif
@@ -1521,7 +1521,7 @@
#ifdef CONFIG_MSM_IDLE_STATS
t1 = ktime_to_ns(ktime_get());
- msm_pm_add_stat(MSM_PM_STAT_NOT_IDLE, t1 - t2);
+ msm_pm_add_stat(MSM_PM_STAT_NOT_IDLE, t1 - __get_cpu_var(t2));
msm_pm_add_stat(MSM_PM_STAT_REQUESTED_IDLE, timer_expiration);
exit_stat = MSM_PM_STAT_IDLE_SPIN;
#endif
@@ -1642,8 +1642,8 @@
}
#ifdef CONFIG_MSM_IDLE_STATS
- t2 = ktime_to_ns(ktime_get());
- msm_pm_add_stat(exit_stat, t2 - t1);
+ __get_cpu_var(t2) = ktime_to_ns(ktime_get());
+ msm_pm_add_stat(exit_stat, __get_cpu_var(t2) - t1);
#endif
}