From owner-freebsd-current@FreeBSD.ORG Tue Jan 4 21:21:44 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 CDF8216A4CE for ; Tue, 4 Jan 2005 21:21:44 +0000 (GMT) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62A7243D49 for ; Tue, 4 Jan 2005 21:21:44 +0000 (GMT) (envelope-from Maksim.Yevmenkin@savvis.net) Received: from out001.email.savvis.net (out001.apptix.savvis.net [216.91.32.44])j04LLJLk031750; Tue, 4 Jan 2005 15:21:19 -0600 Received: from s228130hz1ew03.apptix-01.savvis.net ([10.146.4.28]) by out001.email.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Tue, 4 Jan 2005 15:21:17 -0600 Received: from [10.254.186.111] ([66.35.239.94]) by s228130hz1ew03.apptix-01.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Tue, 4 Jan 2005 15:20:59 -0600 Message-ID: <41DB08B9.6090801@savvis.net> Date: Tue, 04 Jan 2005 13:20:57 -0800 From: Maksim Yevmenkin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040822 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jan 2005 21:20:59.0307 (UTC) FILETIME=[491747B0:01C4F2A3] X-ECS-MailScanner: No virus is found cc: Julian Elischer Subject: 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 21:21:44 -0000 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