Subject: Re: Handling orphans in config(1)
To: Alan Barrett <apb@cequrux.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 09/25/2005 12:25:26
--foDS2Cs8aPiYvG2b
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 24, 2005 at 10:55:34PM +0200, Alan Barrett wrote:
> On Sat, 24 Sep 2005, Quentin Garnier wrote:
> > First, the way config(1) currently detects orphans is broken:  it will
> > not warn about doing the following:
> >=20
> >     include "arch/i386/conf/GENERIC"
> >     no pci* at mainbus?
> >=20
> > although it disables completely PCI support.
>=20
> ... and it will warn about this:
>=20
>     pciide* at pci? dev ? function ? flags 0x0000
>     wdc0    at isa? port 0x1f0 irq 14 flags 0x00
>     wdc1    at isa? port 0x170 irq 15 flags 0x00
>     atabus* at ata?
>     wd0     at atabus0 drive 0
>=20
> atabus0 is not explicitly mentioned anywhere, so config complains that
> wd0 is orphaned.  At run time, there is either an atabus0 at pciide0, or
> an atabus0 at wdc0, and wd0 attaches fine in both cases.  It seems to me
> that this case should work without a warning, but (at present) at least
> it works.  I hope your patch doesn't make it stop working.

It does make it stop working, as I haven't change anything in the unit
detection part.

I'll have a look at how it could be change to accept referencing a
specific device when the parent has at least a wildcard intance.

In any case, adding an 'atabus0 at ata?' line should just work, and
seems much more logical to me.  Because if for some reason you have

    dev1 at attr?
    dev* at otherattr?

the devices matched by the wildcarded line will be numbered started with
dev2, so you'll never have a dev0.  (Yes, this is a questionable
behaviour, too.)

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--foDS2Cs8aPiYvG2b
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQzZ7FtgoQloHrPnoAQJf1wf/cAlL0JdYFc7ltBEowSC4CCifT2vW8uCB
OX+KOm8ZXmSYvUrB61E6PluIeEf8YaWzmyp+OFA4XtCcTtONOius+T59vwIZFtOq
+o4obr/sqPO6pVxcOprxeLBGdqvrjRJuGdp1uCo0iz9zWiKQ+TxjVRF4s2m6TS8J
dDSzRfN69zHb1582I+BBTQ2AyKrSq4pfvbNX2P0N0NSmflDiJ2wOvgSkKs2v3jj2
CNGr9QTyTeTGsKhpC9snB/urZl322piknXhm4AUEL3db4tEmV5HqYwq2J+sqkdgP
sxhQljC7aAbB/5bfblhSdaActZl1xM4WBjf70F12P+2Q4TKG66VPbw==
=EwFw
-----END PGP SIGNATURE-----

--foDS2Cs8aPiYvG2b--