Colin Cross 237ec6f2e5 ARM: 7486/1: sched_clock: update epoch_cyc on resume
Many clocks that are used to provide sched_clock will reset during
suspend.  If read_sched_clock returns 0 after suspend, sched_clock will
appear to jump forward.  This patch resets cd.epoch_cyc to the current
value of read_sched_clock during resume, which causes sched_clock() just
after suspend to return the same value as sched_clock() just before
suspend.

In addition, during the window where epoch_ns has been updated before
suspend, but epoch_cyc has not been updated after suspend, it is unknown
whether the clock has reset or not, and sched_clock() could return a
bogus value.  Add a suspended flag, and return the pre-suspend epoch_ns
value during this period.

The new behavior is triggered by calling setup_sched_clock_needs_suspend
instead of setup_sched_clock.

Signed-off-by: Colin Cross <ccross@android.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-08-11 09:15:58 +01:00
..
2012-06-20 14:39:36 -07:00
2009-02-01 11:01:22 +05:30
2012-03-29 18:02:10 -07:00
2012-07-05 13:06:32 +01:00
2012-04-03 10:59:10 -07:00
2012-03-28 18:30:01 +01:00
2012-03-28 18:30:01 +01:00
2012-03-28 18:30:01 +01:00
2012-03-28 18:30:01 +01:00
2012-04-26 12:06:11 +02:00
2012-03-28 18:30:01 +01:00
2012-03-28 18:30:01 +01:00
2012-07-05 09:50:55 +01:00
2012-03-28 18:30:01 +01:00
2009-03-15 21:01:20 -04:00
2009-05-29 08:40:02 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-03-20 21:48:30 +08:00
2012-05-25 08:39:25 +01:00
2010-10-07 14:08:55 +01:00
2010-10-29 13:14:40 -05:00
2012-07-24 15:27:28 +08:00
2012-02-23 20:19:04 -07:00
2012-03-24 09:38:54 +00:00
2012-04-25 19:49:28 +01:00
2010-10-01 22:32:18 -04:00
2008-09-04 09:46:11 +01:00
2008-11-27 12:37:59 +00:00
2012-03-28 18:30:01 +01:00
2012-03-28 18:30:01 +01:00
2012-01-03 22:55:17 -05:00
2011-03-31 11:26:23 -03:00
2012-01-16 08:56:25 -06:00
2011-07-12 11:19:29 -05:00