ARM: tegra11x: more accurate sleep time
authorBo Yan <byan@nvidia.com>
Wed, 23 Jan 2013 19:02:16 +0000 (11:02 -0800)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 19:51:49 +0000 (12:51 -0700)
commite99705a12f47d23c6adcc01c729696a6aee0f409
treebc1a72cde4ccf7b81622374caf447729b68ef831
parentde38524106d87ef7f7a9cd215710728aa82f1df9
ARM: tegra11x: more accurate sleep time

The sleep length in tick data structure does not reflect how long
timer has been running, thus the expected wake up trigger may be
set to a value which is too late.

Directly accessing timer register to get the next timer event,
which is then used to calculate the expected wake up time.

This implies we are sleeping shorter than before in case of cluster
power down, but will make sure we don't oversleep.

Change-Id: I84598db30b6a739103026d090b130f3adb63147b
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/193483
(cherry picked from commit f51efbce4b67bfb79cdb68f2613e58b080634b37)
Reviewed-on: http://git-master/r/196111
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>
arch/arm/mach-tegra/cpuidle-t11x.c
arch/arm/mach-tegra/timer.c
arch/arm/mach-tegra/timer.h