summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-04-04 16:24:26 +0000
committerShaun Ruffell <sruffell@digium.com>2011-04-04 16:24:26 +0000
commit46819b3518c0c13128be8e3ec3831a3af95880ae (patch)
treed55096d4910f27a49e8b9a99c2a0aad2e0601ecf
parent19a8616daeff1843e64e9956c7662bd1f50fc771 (diff)
core timer: don't hang when the clock goes back.
If the clock shifts back, don't hang in a loop of running process_masterspan from the timer interrupt forever. Fixes a regression of r9407. (closes issue #19035) Reported by: tzafrir Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> After talking with Tzafrir on IRC, I combined the check if your far ahead with the check if you're behind and added a '\n' at the end of the existing "detected time shift" message. That is why this patch is different than what is posted on issue #19035. Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Michael Spiceland <mspiceland@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9876 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 8a634d3..218f87f 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -8971,15 +8971,15 @@ static void coretimer_func(unsigned long param)
/*
* If the system time has changed, it is possible for us to be
* far behind. If we are more than MS_LIMIT milliseconds
- * behind, just reset our time base and continue so that we do
- * not hang the system here.
+ * behind (or ahead in time), just reset our time base and
+ * continue so that we do not hang the system here.
*
*/
difference = ms_since_start - msecs_processed(&core_timer);
- if (unlikely(difference > MS_LIMIT)) {
+ if (unlikely((difference > MS_LIMIT) || (difference < 0))) {
if (printk_ratelimit()) {
module_printk(KERN_INFO,
- "Detected time shift.");
+ "Detected time shift.\n");
}
atomic_set(&core_timer.count, 0);
atomic_set(&core_timer.last_count, 0);