From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 19:01:14 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CF7637B401 for ; Wed, 6 Aug 2003 19:01:14 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCF1943F3F for ; Wed, 6 Aug 2003 19:01:12 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h7720raK003498 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 7 Aug 2003 04:01:04 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h7720mAx048271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Aug 2003 04:00:49 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h7720mNS038643; Thu, 7 Aug 2003 04:00:48 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h7720lfT038642; Thu, 7 Aug 2003 04:00:47 +0200 (CEST) Date: Thu, 7 Aug 2003 04:00:46 +0200 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20030807020046.GH35859@cicely12.cicely.de> References: <20030807001244.GF35859@cicely12.cicely.de> <20030806.183710.132444148.imp@bsdimp.com> <20030807005810.GG35859@cicely12.cicely.de> <20030806.192742.85412759.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030806.192742.85412759.imp@bsdimp.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: ticso@cicely12.cicely.de cc: freebsd-hackers@freebsd.org cc: phk@phk.freebsd.dk cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2003 02:01:14 -0000 On Wed, Aug 06, 2003 at 07:27:42PM -0600, M. Warner Losh wrote: > In message: <20030807005810.GG35859@cicely12.cicely.de> > Bernd Walter writes: > : The host bridge is not available yet at probing time of the host bridge. > : What we have is the host bridges parent (nexus) in the calling function. > : Either we hand out the parents device_t to nexus_pcib_is_host_bridge, or > : we find it out later. > > Don't you mean legacy_pcib_is_host_bridge? That's where the matching Yes - I looked at 5.1-RELEASE code. Layering seems to have been changed since then. > is done in current right now (well, at least as of my last sync) If > so, passing the host bridge's device down to it would be trivial to > add. It would also allow other CPUs with builtin host bridges to do How? legacy_pcib_is_host_bridge is called before BUS_ADD_CHILD. > similar tricks to the one that is done for the ELAN. These sorts of > features have been very common in other CPU families, and there's no > reason to think that there won't be more of them in the x86 family as > time goes on. point taken. > I'm not sure that adding it to nexus at this stage of the boot would > truly work. Since the legacy device has decided to attach, the nexus > bus is already walking through its children. Adding a child during > that walk strikes me as dangerous, since we have no locking on the > children element of the device_t. Hmmm, looks I just found a source > of problems in my newbus locking code that might explain some weird > things happening when I enable it.... Thanks for making me go look :-) OK - that's an argument to avoid nexus. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de