Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2004 10:53:51 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no>
Cc:        dfr@freebsd.org
Subject:   Re: newbus flaw
Message-ID:  <20040512175351.GF601@funkthat.com>
In-Reply-To: <xzphdulepy6.fsf@dwp.des.no>
References:  <xzp4qqn6n9v.fsf@dwp.des.no> <20040512010240.GD601@funkthat.com> <xzphdulepy6.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smørgrav wrote this message on Wed, May 12, 2004 at 15:26 +0200:
> John-Mark Gurney <gurney_j@efn.org> writes:
> > You are incorrect in assuming you can't find out if another child already
> > exists.. Usually this is a problem of properly allocating resources so
> > that you know the other child exists.  Since you are using identify, you
> > already don't have a "self describing" bus, which means that you have
> > to either use hints, or another method to make sure that your device
> > doesn't already exist.
> 
> It's not quite that simple.  See the block comment at the top of
> src/sys/dev/ichwd/ichwd.c for an explanation.

Sorry, I had an out of date cvsup and hadn't received ichwd yet.

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?

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.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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