Re: newbus flaw

From: Doug Rabson (dfr_at_nlsystems.com)
Date: 05/13/04

  • Next message: Dag-Erling Smørgrav: "Re: newbus flaw"
    To: des@des.no (Dag-Erling Smørgrav)
    Date: Thu, 13 May 2004 09:27:01 +0100
    
    

    On Wednesday 12 May 2004 21:30, Dag-Erling Smørgrav wrote:
    > 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.

    When the old module unloaded, its driver will have detached from the
    device which it created. There is no reference to an old driver_t. Its
    perfectly safe for the new driver to use the old device.
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Dag-Erling Smørgrav: "Re: newbus flaw"

    Relevant Pages