dahdi: Decrease the initial coretimer delay to 4ms from 1 second.

DAHDI currently waits a second before checking if a board driver is
calling dahdi_receive and switching to internal timing. Some versions of
Asterisk (I was looking at 1.4.42 when writing this) only wait 300ms for
a timer to expire when first starting and verifying that DAHDI is
properly configured. This can result in a

"ERROR[27673] asterisk.c: Asterisk has detected a problem with your DAHDI
configuration and will shutdown for your protection. You have options:"

message if asterisk is started soon after loading DAHDI.

This change sets the inital polling interval to the same as that used
during normal coretimer operation, 4ms. The interval will still be
slowed to 1 second if a board driver starts calling dahdi_receive().

DAHDI-892.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10200 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-09-13 18:28:58 +00:00
parent dc6ef91241
commit d4ee448c7e

View File

@ -9227,12 +9227,12 @@ static void coretimer_init(void)
init_timer(&core_timer.timer);
core_timer.timer.function = coretimer_func;
core_timer.start_interval = current_kernel_time();
core_timer.timer.expires = jiffies + HZ;
atomic_set(&core_timer.count, 0);
atomic_set(&core_timer.shutdown, 0);
core_timer.interval = max(msecs_to_jiffies(DAHDI_MSECS_PER_CHUNK), 1UL);
if (core_timer.interval < (HZ/250))
core_timer.interval = (HZ/250);
core_timer.timer.expires = jiffies + core_timer.interval;
add_timer(&core_timer.timer);
}