linux/arch
Richard Mortimer 9eb3394bf2 [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>
2006-01-17 15:21:01 -08:00
..
alpha [PATCH] alpha: task_pt_regs() 2006-01-12 09:08:50 -08:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-01-14 19:43:21 -08:00
arm26 [PATCH] arm26: s/task_threas_info/task_thread_info/ 2006-01-16 23:15:27 -08:00
cris [PATCH] cris: task_thread_info() 2006-01-12 09:08:58 -08:00
frv [PATCH] frv: task_thread_info(), task_stack_page() 2006-01-12 09:08:54 -08:00
h8300 [PATCH] h8300: task_stack_page() 2006-01-12 09:08:55 -08:00
i386 [PATCH] x86_64: add __meminit for memory hotplug 2006-01-16 23:18:35 -08:00
ia64 Pull perfmon-montecito into release branch 2006-01-16 20:02:24 -08:00
m32r [PATCH] m32r: task_pt_regs(), task_stack_page(), task_thread_info() 2006-01-12 09:08:54 -08:00
m68k [PATCH] m68k: console code in head.S needs framebuffer support built in 2006-01-12 09:09:06 -08:00
m68knommu [PATCH] m68knommu: task_stack_page() 2006-01-12 09:08:55 -08:00
mips [PATCH] mips: add pm_power_off 2006-01-16 23:15:26 -08:00
parisc [PATCH] Add parisc_bus_type probe and remove methods 2006-01-13 11:26:06 -08:00
powerpc powerpc/32: Restore previous version of 32-bit PCI code 2006-01-15 22:05:47 +11:00
ppc powerpc/32: Restore previous version of 32-bit PCI code 2006-01-15 22:05:47 +11:00
s390 [PATCH] s390: cputime misaccounting 2006-01-14 18:27:09 -08:00
sh [PATCH] sh: Move CPU subtype configuration to its own Kconfig 2006-01-16 23:15:28 -08:00
sh64 [PATCH] sh64: task_stack_page() 2006-01-12 09:08:57 -08:00
sparc [PATCH] sparc: task_stack_page() 2006-01-12 09:08:53 -08:00
sparc64 [SPARC64]: Eliminate race condition reading Hummingbird STICK register 2006-01-17 15:21:01 -08:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-01-15 16:43:29 -08:00
v850 [PATCH] v850: task_stack_page(), task_pt_regs() 2006-01-12 09:08:54 -08:00
x86_64 [PATCH] x86_64: add x86-64 support for memory hot-add 2006-01-16 23:18:35 -08:00
xtensa [PATCH] xtensa: task_pt_regs(), task_stack_page() 2006-01-12 09:08:54 -08:00