summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2012-03-15 15:41:27 +0000
committerShaun Ruffell <sruffell@digium.com>2012-03-15 15:41:27 +0000
commit01e8269c009b4ab8033ebe89d2260254f20327af (patch)
tree185307f8f0595eb5e65dadb267e7f287fade76ce
parent0e97657da8bc55ab2cd77fbcf68027f4b50616ed (diff)
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@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10482 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 6db1f3f..88e44be 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -9595,7 +9595,7 @@ static void coretimer_func(unsigned long param)
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 @@ static void coretimer_init(void)
{
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);