From dan@m9-64.freebsd.cz  Sat Apr 19 00:22:38 2014
Return-Path: <dan@m9-64.freebsd.cz>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id B233870A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2014 00:22:38 +0000 (UTC)
Received: from m9-64.freebsd.cz (m9-64.freebsd.cz [195.113.20.201])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4095A11FB
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2014 00:22:37 +0000 (UTC)
Received: from m9-64.freebsd.cz (localhost [127.0.0.1])
	by m9-64.freebsd.cz (8.14.5/8.14.5) with ESMTP id s3J0MZIR082963
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2014 02:22:35 +0200 (CEST)
	(envelope-from dan@m9-64.freebsd.cz)
Received: (from root@localhost)
	by m9-64.freebsd.cz (8.14.5/8.14.5/Submit) id s3J0MZkc082962;
	Sat, 19 Apr 2014 02:22:35 +0200 (CEST)
	(envelope-from dan)
Message-Id: <201404190022.s3J0MZkc082962@m9-64.freebsd.cz>
Date: Sat, 19 Apr 2014 02:22:35 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ patch ] misc/dahdi-kmod: rc.d/dahdi start doesn't initialise properly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         188780
>Category:       ports
>Synopsis:       [ patch ] misc/dahdi-kmod: rc.d/dahdi start doesn't initialise properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    fjoe
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 19 00:30:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Sat Apr 19 00:30:04 UTC 2014
>Originator:     Dan Lukes
>Release:        FreeBSD 9.1-RELEASE-p11 amd64
>Organization:
>Environment:
System: FreeBSD 9.1-RELEASE-p11 #4 r264285M
$FreeBSD: head/misc/dahdi-kmod/files/dahdi.in 340872 2014-01-24 00:14:07Z

>Description:
	The startup script rc.d/dahdi will load required kernel modules then
call dahdi_cfg immediately in attempt to configure them

	Unfortunately, kernel's device probe and attach may take some time so 
dahdi_cfg may fail because device is not ready yet. 

	And when device become ready it doesn't work as it is not configured 
by dahdi_cfg

>How-To-Repeat:
	Observed with wct4xxp card and E1 line. Just try it.
>Fix:

	Give kernel module a few seconds to initialize hardware in full.

 --- patch begins here ---
--- misc/dahdi-kmod/files/dahdi.in~	2014-02-03 20:58:05.000000000 +0100
+++ misc/dahdi-kmod/files/dahdi.in	2014-04-19 02:08:28.000000000 +0200
@@ -62,6 +62,7 @@
 	devfs rule apply path 'dahdi/*' mode 0664 user root group dahdi
 
 	# run configuration utilities
+	/bin/sleep 5
 	%%PREFIX%%/sbin/dahdi_cfg
 	if [ -r %%PREFIX%%/etc/fxotune.conf ]; then
 		echo "Starting fxotune."
 --- patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->fjoe 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Apr 19 00:30:04 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188780 
>Unformatted:
