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

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Mar 15 10:41:31 CDT 2012


Author: sruffell
Date: Thu Mar 15 10:41:27 2012
New Revision: 10482

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10482
Log:
dahdi: Use monotonic clock for coretimer.

DAHDI internal timing currently uses the "wall clock" to determine how much
time is passing for mixing and timers. When the wall time changes, like when
the system time is set via ntp or date, DAHDI currently will display a
"Detected time shift" message since it believes there is too much audio to
mix. There may also be audio problems if the wall time is shifting
occasionally due to slewing of the clock.

Now use a monotonic clock to determine how much real-time has passed for
timing purposes. This makes DAHDI insensitive to any changes in the wall time
on the system.

This only applies when using DAHDI's internal timer like when there are not
any telphony cards installed. There are still potential audio problems if the
platform is unable to accurately determine the passage of time.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks 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=10482&r1=10481&r2=10482
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Thu Mar 15 10:41:27 2012
@@ -9595,7 +9595,7 @@
 	const long MS_LIMIT = 3000;
 	long difference;
 
-	now = current_kernel_time();
+	ktime_get_ts(&now);
 
 	if (atomic_read(&core_timer.count) ==
 	    atomic_read(&core_timer.last_count)) {
@@ -9668,7 +9668,7 @@
 {
 	init_timer(&core_timer.timer);
 	core_timer.timer.function = coretimer_func;
-	core_timer.start_interval = current_kernel_time();
+	ktime_get_ts(&core_timer.start_interval);
 	atomic_set(&core_timer.count, 0);
 	atomic_set(&core_timer.shutdown, 0);
 	core_timer.interval = max(msecs_to_jiffies(DAHDI_MSECS_PER_CHUNK), 1UL);




More information about the dahdi-commits mailing list