From owner-freebsd-arch@FreeBSD.ORG Wed May 12 10:53:54 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 1C46C16A4CE for ; Wed, 12 May 2004 10:53:54 -0700 (PDT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B9E743D31 for ; Wed, 12 May 2004 10:53:53 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 2818 invoked from network); 12 May 2004 17:53:52 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 May 2004 17:53:52 -0000 Received: from hydrogen.funkthat.com (ryjgxw@localhost.funkthat.com [127.0.0.1])i4CHrpEx012903; Wed, 12 May 2004 10:53:52 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id i4CHrp9r012902; Wed, 12 May 2004 10:53:51 -0700 (PDT) Date: Wed, 12 May 2004 10:53:51 -0700 From: John-Mark Gurney To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20040512175351.GF601@funkthat.com> Mail-Followup-To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , arch@freebsd.org, dfr@freebsd.org References: <20040512010240.GD601@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html 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 Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2004 17:53:54 -0000 Dag-Erling Smørgrav wrote this message on Wed, May 12, 2004 at 15:26 +0200: > John-Mark Gurney 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."