From owner-freebsd-current@FreeBSD.ORG Tue Jan 4 22:27:06 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 0036116A4CE for ; Tue, 4 Jan 2005 22:27:05 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC40E43D49 for ; Tue, 4 Jan 2005 22:27:05 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 9B1F37A403; Tue, 4 Jan 2005 14:27:05 -0800 (PST) Message-ID: <41DB1839.9080104@elischer.org> Date: Tue, 04 Jan 2005 14:27:05 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Maksim Yevmenkin References: <41DB08B9.6090801@savvis.net> <41DB1310.4060807@cronyx.ru> <41DB1700.7060708@savvis.net> In-Reply-To: <41DB1700.7060708@savvis.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: current@freebsd.org cc: Roman Kurakin Subject: Re: [Spam] 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:27:06 -0000 Maksim Yevmenkin wrote: > Roman Kurakin wrote: > >> Maksim Yevmenkin: >> >>> 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 >> > ^^^^^^^^^^^^^^ this > should be SI_ORDER_MIDDLE :) > >>> DECLARE_MODULE). >> >> >> I thought this is the task of MODULE_DEPEND. > > > i thought so too :) but it appears to work only when module is > _loaded_ (by hand or from /boot/loader.conf), i.e. it does not work if > module was compiled in the kernel. maybe the config stuff could be extended to integrate the module dependency stuff along with the suggested order by moving things backwards in the list if their dependencies suggest it. (after the bubble sort). > > >> >>> 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 >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to >>> "freebsd-current-unsubscribe@freebsd.org" >> >> >> >> >>