]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[PATCH] Fix timekeeping on sparc64 ultra-IIe machines
authorRichard Mortimer <richm@oldelvet.org.uk>
Tue, 17 Jan 2006 23:23:00 +0000 (15:23 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Jan 2006 06:13:17 +0000 (22:13 -0800)
commitd93f4eb4134d693be834627d31cd7c4aac427911
treebd1d8b9ea03ff8dd4094d5f4b1693717db4195bb
parent4f3bfdc30b23e63d9c215e47192f427c2d7d4774
[PATCH] Fix timekeeping on sparc64 ultra-IIe machines

[SPARC64]: Eliminate race condition reading Hummingbird STICK register

Ensure a consistent value is read from the STICK register by ensuring
that both high and low are read without high changing due to a roll
over of the low register.

Various Debian/SPARC users (myself include) have noticed problems with
Hummingbird based systems. The symptoms are that the system time is
seen to jump forward 3 days, 6 hours, 11 minutes give or take a few
seconds. In many cases the system then hangs some time afterwards.

I've spotted a race condition in the code to read the STICK register.
I could not work out why 3d, 6h, 11m is important but guess that it is
due to the 2^32 jump of STICK (forwards on one read and then the next
read will seem to be backwards) during a timer interrupt. I'm guessing
that a change of -2^32 will get converted to a large unsigned
increment after the arithmetic manipulation between STICK,
nanoseconds, jiffies etc.

I did a test where I modified __hbird_read_stick to artificially
inject rollover faults forcefully every few seconds. With this I saw
the clock jump over 6 times in 12 hours compared to once every month
or so.

Signed-off-by: Richard Mortimer <richm@oldelvet.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc64/kernel/time.c