From owner-freebsd-arch@FreeBSD.ORG Wed May 12 10:41:53 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 CDC6816A4CE for ; Wed, 12 May 2004 10:41:53 -0700 (PDT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 566BE43D49 for ; Wed, 12 May 2004 10:41:53 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 8045 invoked from network); 12 May 2004 17:41:52 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail3.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 May 2004 17:41:52 -0000 Received: from hydrogen.funkthat.com (lqnune@localhost.funkthat.com [127.0.0.1])i4CHfnEx012673; Wed, 12 May 2004 10:41:51 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id i4CHfnvL012672; Wed, 12 May 2004 10:41:49 -0700 (PDT) Date: Wed, 12 May 2004 10:41:48 -0700 From: John-Mark Gurney To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20040512174148.GE601@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:41:53 -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. 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."