From owner-freebsd-current@freebsd.org Mon Apr 18 18:53:49 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347DBB12F2A for ; Mon, 18 Apr 2016 18:53:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16CA21ACA for ; Mon, 18 Apr 2016 18:53:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 31539B989; Mon, 18 Apr 2016 14:53:48 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: Mis-use of BUS_PASS_ORDER_MIDDLE Date: Mon, 18 Apr 2016 10:43:17 -0700 Message-ID: <1611132.EbTME86UTe@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 18 Apr 2016 14:53:48 -0400 (EDT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 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: Mon, 18 Apr 2016 18:53:49 -0000 On Monday, April 18, 2016 11:10:12 PM Howard Su wrote: > I noticed several places there are code like this, especially in some= arm > low level drivers. > EARLY_DRIVER_MODULE(aw_ccu, simplebus, aw_ccu_driver, aw_ccu_devclass= , > 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); >=20 > =E2=80=8BI feel the usage of BUS_PASS_ORDER_MIDDLE is misused. There = are another > macro EARLY_DRIVER_MODULE_ORDERED, which take an additional parameter= > "order". I believe BUS_PASS_ORDER_xxx is used for that parameter. No, this is actually correct. The _ORDERED variants actually accept a SI_ORDER_* value to determine how drivers contained in a single .ko fil= e are registered (in particular if you have several drivers in a .ko file= you typically want the "top-most" driver to attach last so that all the= other drivers are ready once the actual device is attached). --=20 John Baldwin