Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2004 22:30:16 +0200
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        arch@freebsd.org
Cc:        dfr@freebsd.org
Subject:   Re: newbus flaw
Message-ID:  <xzp8yfxcrs7.fsf@dwp.des.no>
In-Reply-To: <20040512175351.GF601@funkthat.com> (John-Mark Gurney's message of "Wed, 12 May 2004 10:53:51 -0700")
References:  <xzp4qqn6n9v.fsf@dwp.des.no> <20040512010240.GD601@funkthat.com> <xzphdulepy6.fsf@dwp.des.no> <20040512175351.GF601@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney <gurney_j@efn.org> writes:
> You're always going to be a child of nexus, and since I assume from
> the comment that there can only ever be one child.  Also, why do you
> find_child w/ unit number 0, but then add a child with unit -1?  Why
> not add it unit 0, and make it fail if that already exists?

just didn't think about it.  the documentation is somewhat lacking, so
some of the code is based on examining existing code and headers and
guessing at what it all means.

> Also, it seems to me that if dev already exists, that you shouldn't
> reset the driver and desc.  This should be harmless, but if for some
> reason you are called on an attached device, it could cause problems.

it'll all go pear-shaped if you don't.  if an ichwd device already
exists, it is a leftover from a previous module load / unload cycle
and the driver_t it references no longer exists.  ichwd_identify()
should probably KASSERT that the device it finds isn't attached - I'm
pretty sure it can't happen.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp8yfxcrs7.fsf>