[svn-commits] sruffell: linux/trunk r9876 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 4 11:24:32 CDT 2011


Author: sruffell
Date: Mon Apr  4 11:24:26 2011
New Revision: 9876

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9876
Log:
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 at 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 at digium.com>
Acked-by: Michael Spiceland <mspiceland at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9876&r1=9875&r2=9876
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Apr  4 11:24:26 2011
@@ -8971,15 +8971,15 @@
 		/*
 		 * 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);




More information about the svn-commits mailing list