From owner-freebsd-current@FreeBSD.ORG Tue Jan 4 22:41:07 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF91216A4CE for ; Tue, 4 Jan 2005 22:41:07 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63EC643D54 for ; Tue, 4 Jan 2005 22:41:07 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id j04MhurL014867; Tue, 4 Jan 2005 15:43:56 -0700 (MST) (envelope-from scottl@freebsd.org) Message-ID: <41DB1B24.5040906@freebsd.org> Date: Tue, 04 Jan 2005 15:39:32 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040929 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Maksim Yevmenkin References: <41DB08B9.6090801@savvis.net> In-Reply-To: <41DB08B9.6090801@savvis.net> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: current@freebsd.org cc: Julian Elischer Subject: Re: netgraph(3) initialization order X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2005 22:41:07 -0000 Maksim Yevmenkin wrote: > Dear Hackers, > > would anyone object if i change SI_ORDER_MIDDLE in the > /sys/netgraph/ng_base.c:2994 to say SI_ORDER_THIRD, i.e. > > change > > DECLARE_MODULE(netgraph, netgraph_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); > > to > > DECLARE_MODULE(netgraph, netgraph_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); > > the reason for this change is that bluetooth device drivers depend on > netgraph(4) and when both netgraph(4) and bluetooth device driver (such > as ng_ubt(4)) compiled in the kernel you get a crash. basically > ng_ubt(4) mod_load callback is called before netgraph(4) mod_load > callback and ng_findtype() crashes on uninitialized mutex (DEVICE_MODULE > macro passes SI_SUB_DRIVERS, SI_ORDER_THIRD to the DECLARE_MODULE). > > > option #2 would be to have DEVICE_MODULE_ORDERED macro which accepts two > extra parameters. > > > and finally option #3 would be to duplicate entire content of the > DEVICE_MODULE macro in all bluetooth device drivers and specify order in > DECLARE_MODULE macro. > > > any thoughts? > > thanks, > max It might make more sense to stop classifying netgraph as a driver in SI_SUB_DRIVERS and instead put it into a SYSINIT that happens prior to SI_SUB_DRIVERS. Scott