From owner-freebsd-stable Sat Jul 8 14:22: 4 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mout1.freenet.de (mout1.freenet.de [194.97.50.132]) by hub.freebsd.org (Postfix) with ESMTP id 3CEB937B7FE; Sat, 8 Jul 2000 14:22:00 -0700 (PDT) (envelope-from se@freebsd.org) Received: from [194.97.50.135] (helo=mx2.freenet.de) by mout1.freenet.de with esmtp (Exim 3.15 #1) id 13B22o-000624-00; Sat, 08 Jul 2000 23:21:50 +0200 Received: from a6498.pppool.de ([213.6.100.152] helo=StefanEsser.FreeBSD.org) by mx2.freenet.de with esmtp (Exim 3.14 #3) id 13B22o-0001o6-00; Sat, 08 Jul 2000 23:21:50 +0200 Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 14CCED70; Sat, 8 Jul 2000 22:01:49 +0200 (CEST) Date: Sat, 8 Jul 2000 22:01:48 +0200 From: Stefan Esser To: Doug White Cc: Remy Nonnenmacher , freebsd-stable@FreeBSD.ORG, Stefan Esser Subject: Re: Fixing PCI device locations Message-ID: <20000708220148.A2104@StefanEsser.FreeBSD.org> Reply-To: Stefan Esser References: <200006261436.QAA10618@luxren2.boostworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from dwhite@resnet.uoregon.edu on Mon, Jun 26, 2000 at 09:18:38AM -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2000-06-26 09:18 -0700, Doug White wrote: > On Mon, 26 Jun 2000, Remy Nonnenmacher wrote: > > I recently upgraded a server from 3.4 to 4-stable and was hurted by the > > PCI device scanning not done in the same order on the two versions. > > > > Mainly, the server have 6 SCSI busses over 3 devices and two PCI > > busses. (da0 on 3.4 ended up on da52 under 4-stable) > > > > While provisions are made for fixing SCSI controlers to busses (ieg: ahc > > to scbus) and disks to scbuses, is there a way to fix SCSI controlers > > to PCI locations ? > > > > (something like "device ahc0 on pci0.11.1") > > Not at this time, but it may appear at some time in the future, given an > enterprising individual. A great many people, including embedded systems > builders, would be thankful for such a feature. I had plans to improve the support for wired PCI devices that was in 3.0, but have not looked at the problem after the newbus modifications. There is one problem, which needs to be understood, but its not that hard ;-) The PCI probe reports bus numbers as assigned by the PCI BIOS. If we want to specify locations of wired devices, we should NOT use the bus number they are reported on, or bad things will happen, if some new PCI bridge is installed and all the buses are suddenly renumbered ... We need a way to assign "labels" to PCI buses. This may be best done like this: device pcibus1 at pci 0.10.0 device pcibus2 at pci 1.4.0 device ahc0 at pci 2.0.0 Keep in mind, that there may be a PCI bridge at 0.9.0, which already got bus number 1 assigned by the BIOS. For that reason, we now have two PCI number schemes: The bus numbers as programmed into the PCI chip-set and bridges, and our "logical" bus numbers, which are only used for reference in order to bind device driver instances to devices that are physically connected to some PCI slot (possibly via multiple bridges). The above lines should be interpreted to mean: device pcibus X at pci 0.10.0 device pcibus Y at pci X.4.0 device ahc0 at pci Y.0.0 and X and Y can come out as 3 and 5 respectively, for example (and would be reported in the boot log accordingly). This will confuse people that want to add a device on yet another PCI bus, since numbers in the config and numbers reported will always diverge, whenever a PCI bridge is added. But in order to assign fixed unit numbers to cards in certain slots, this would be better than nothing. And there just should be comments, that remind you that the intermediate bus numbers are only "labeled", not "wired". But the device is attached under a predetermined name, and that is what counts ;-) ( The situation is not that different from wired SCSI devices, just that a SCSI bus does not have the concept of a bus number, and we can thus choose scbus (unit) numbers without the risk of confusion. PCI buses have numbers assigned by the BIOS, long before we get a chance to state our preferences ;-) Anybody got a better concept ? Regards, STefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message