newbus flaw

John-Mark Gurney gurney_j at efn.org
Wed May 12 10:41:53 PDT 2004


Dag-Erling Smørgrav wrote this message on Wed, May 12, 2004 at 15:26 +0200:
> John-Mark Gurney <gurney_j at 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."


More information about the freebsd-arch mailing list