aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/time.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-11-23 20:07:17 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-12 11:35:02 -0800
commitbfaebb8af017d443937022cf3d5735d726e4f711 (patch)
tree8f88264306700916b41aa8b0521fbf6f57db6fae /arch/powerpc/kernel/time.c
parenta7b8c32b67b60fe9e8b53bb86bb7a04631e6e262 (diff)
downloadkernel_samsung_aries-bfaebb8af017d443937022cf3d5735d726e4f711.zip
kernel_samsung_aries-bfaebb8af017d443937022cf3d5735d726e4f711.tar.gz
kernel_samsung_aries-bfaebb8af017d443937022cf3d5735d726e4f711.tar.bz2
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>
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r--arch/powerpc/kernel/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 03b29a6..2de304a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -889,6 +889,15 @@ static void __init clocksource_init(void)
clock->name, clock->mult, clock->shift);
}
+void decrementer_check_overflow(void)
+{
+ u64 now = get_tb_or_rtc();
+ struct decrementer_clock *decrementer = &__get_cpu_var(decrementers);
+
+ if (now >= decrementer->next_tb)
+ set_dec(1);
+}
+
static int decrementer_set_next_event(unsigned long evt,
struct clock_event_device *dev)
{