From owner-freebsd-arch@FreeBSD.ORG Thu May 13 01:27:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 42EE616A4CE; Thu, 13 May 2004 01:27:16 -0700 (PDT) Received: from herring.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id D65EC43D1D; Thu, 13 May 2004 01:27:13 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from herring.rabson.org (herring.rabson.org [10.0.0.2]) by herring.rabson.org (8.12.11/8.12.11) with ESMTP id i4D8R1XX037364; Thu, 13 May 2004 09:27:01 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Thu, 13 May 2004 09:27:01 +0100 User-Agent: KMail/1.6.1 References: <20040512175351.GF601@funkthat.com> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200405130927.01034.dfr@nlsystems.com> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on herring.rabson.org X-Virus-Scanned: ClamAV version 'clamd / ClamAV version 0.65', clamav-milter version '0.60p' cc: arch@freebsd.org cc: dfr@freebsd.org Subject: Re: newbus flaw X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2004 08:27:16 -0000 On Wednesday 12 May 2004 21:30, Dag-Erling Sm=F8rgrav wrote: > John-Mark Gurney 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=20 device which it created. There is no reference to an old driver_t. Its=20 perfectly safe for the new driver to use the old device.