Date: Wed, 12 May 2004 10:41:48 -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: <20040512174148.GE601@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. I couldn't find ichwd, but I could find ichsmb? In ichsmb.c, doing the device_add_child in _probe is not correct. It should be done at attach time, and removed at detach time. The probe maybe be called multiple times. As far as the assumption of only one process calling methods, I would enforce it by making sure that once a device is attached, any other attempts to attach fail.. That should also solve the problem. -- 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?20040512174148.GE601>