android_kernel_xiaomi_sm8350/arch/sparc64
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
..
boot
kernel [SPARC64]: Eliminate race condition reading Hummingbird STICK register 2006-01-17 15:21:01 -08:00
lib [SPARC64]: Fix userland FPU state corruption. 2005-10-07 13:30:49 -07:00
math-emu
mm [SPARC64]: Fix >8K I/O mappings. 2005-11-29 13:59:03 -08:00
oprofile [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
prom [SPARC64]: Fix powering off on SMP. 2005-10-14 15:26:08 -07:00
solaris [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
defconfig [SPARC64]: Update defconfig. 2006-01-09 14:36:49 -08:00
Kconfig [SPARC64] arch/sparc64/Kconfig: fix HUGETLB_PAGE_SIZE_64K dependencies 2006-01-11 15:55:23 -08:00
Kconfig.debug [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
Makefile [SPARC64]: Stop putting -finline-limit=XXX into CFLAGS 2005-12-20 14:53:05 -08:00