ARM: 6488/1: nomadik: prevent sched_clock() wraparound
authorLinus Walleij <linus.walleij@stericsson.com>
Fri, 19 Nov 2010 09:16:05 +0000 (10:16 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 21 Nov 2010 22:05:57 +0000 (22:05 +0000)
commit8fbb97a2bc9b8c91b5a4588ba80709e48dad3f16
tree7843b6acb76bf1b0679c78fdf3d45402eea8e86f
parent963fec4e0f4993486ee91edfafba0c972834d8c3
ARM: 6488/1: nomadik: prevent sched_clock() wraparound

The current implementation of sched_clock() for the Nomadik
family is based on the clock source that will wrap around without
any compensation. Currently on the Ux500 after 1030 seconds.

Utilize cnt32_to_63 to expand the sched_clock() counter to 63
bits and introduce a keepwarm() timer to assure that sched clock
and this cnt32_to_63 is called atleast once every half period.

When I print out the actual wrap-around time, and using
a year (3600*24*365 seconds) as minumum wrap limit I get an
actual wrap-around of:
sched_clock: using 55 bits @ 8333125 Hz wrap in 416 days

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/plat-nomadik/timer.c