powerpc/time: Handle wrapping of decrementer
commit8e04782a06882913304916bc60960e4fc7405e18
authorAnton Blanchard <anton@samba.org>
Wed, 23 Nov 2011 20:07:17 +0000 (23 20:07 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:29:22 +0000 (12 11:29 -0800)
treec4aeba0d11eb3c731f5f0e15496c666c38cd9ed4
parentf92fed3f1de1942a61978c5e59bbed56eab4ac55
powerpc/time: Handle wrapping of decrementer

commit 37fb9a0231ee43d42d069863bdfd567fca2b61af upstream.

When re-enabling interrupts we have code to handle edge sensitive
decrementers by resetting the decrementer to 1 whenever it is negative.
If interrupts were disabled long enough that the decrementer wrapped to
positive we do nothing. This means interrupts can be delayed for a long
time until it finally goes negative again.

While we hope interrupts are never be disabled long enough for the
decrementer to go positive, we have a very good test team that can
drive any kernel into the ground. The softlockup data we get back
from these fails could be seconds in the future, completely missing
the cause of the lockup.

We already keep track of the timebase of the next event so use that
to work out if we should trigger a decrementer exception.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/include/asm/time.h
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/time.c