Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2016 15:42:40 +0000
From:      Howard Su <howard0su@gmail.com>
To:        John Baldwin <jhb@freebsd.org>, freebsd-current@freebsd.org
Subject:   Re: Mis-use of BUS_PASS_ORDER_MIDDLE
Message-ID:  <CAAvnz_oDM83miGcX_Qh0Rc2f8o=s_hkSiuPkwEacngpxhZS=Ew@mail.gmail.com>
In-Reply-To: <1611132.EbTME86UTe@ralph.baldwin.cx>
References:  <CAAvnz_rmbgM9t47eqV91ASXHddJjMyEucpF4_f-3Ed5pNoM8Bw@mail.gmail.com> <1611132.EbTME86UTe@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 19, 2016 at 2:53 AM John Baldwin <jhb@freebsd.org> wrote:

> On Monday, April 18, 2016 11:10:12 PM Howard Su wrote:
> > I noticed several places there are code like this, especially in some a=
rm
> > low level drivers.
> > EARLY_DRIVER_MODULE(aw_ccu, simplebus, aw_ccu_driver, aw_ccu_devclass,
> >     0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
> >
> > =E2=80=8BI feel the usage of BUS_PASS_ORDER_MIDDLE is misused. There ar=
e 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 file
> 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).
>
Why not use _ORDERED here to achieve same thing?  _ORDERED(....,
SI_ORDER_LAST, BUS_PASS_BUS)?

I am thinking to add some macro like BUS_DRIVER_MODULE, INT_DRIVER_MODULE,
TIMER_DRIVER_MODULE, so that the driver can declare itself in such way. If
we can avoid usage of BUS_PASS_ORDER_XXX, the macro is much cleaner.

I am plan to do is: in autoconf phase, first load timer, int and some bus,
etc low level drivers first, then set cold=3D0, then load other driver to
work around the problem that driver needs special handling on cold which is
not necessary. of course, this may depends on your change of ap_startup.
thoughts?


> --
> John Baldwin
>
--=20
-Howard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAvnz_oDM83miGcX_Qh0Rc2f8o=s_hkSiuPkwEacngpxhZS=Ew>