From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 17:24:16 2005 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 4761C16A4CE for ; Mon, 11 Apr 2005 17:24:16 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EF8343D31 for ; Mon, 11 Apr 2005 17:24:15 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j3BHL84u015220; Mon, 11 Apr 2005 11:21:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 11 Apr 2005 11:21:14 -0600 (MDT) Message-Id: <20050411.112114.36185200.imp@bsdimp.com> To: bms@spc.org From: "M. Warner Losh" In-Reply-To: <20050411134817.GA4176@empiric.icir.org> References: <20050411082600.GA735@empiric.icir.org> <425A7AB3.7040908@samsco.org> <20050411134817.GA4176@empiric.icir.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@FreeBSD.ORG cc: scottl@samsco.org Subject: Re: A question about hot-pluggable PCI. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2005 17:24:16 -0000 In message: <20050411134817.GA4176@empiric.icir.org> Bruce M Simpson writes: : On Mon, Apr 11, 2005 at 07:25:07AM -0600, Scott Long wrote: : > Asking for 'hotplug support' is pretty generic and non-descriptive. Are : > you asking for device level hotplug support, where we carefully drain : > transactions out of a device, device driver, and whatever I/O or network : > or whatever layers are above it? Or are you talking about PCI hotplug : > support? If so, which de-facto standard? Compaq? IBM? ACPI? : > PCI-SIG? Something else? : : Sorry, I thought my original post was quite clear; in order to support : my hot-pluggable PCI chassis, FreeBSD needs to grow the ability to manage : PCI resources without any firmware support (other than possibly the ability : to route interrupts). Since I sent that mail I looked at the requirements : list for 5-STABLE and realized this is in fact on it. The trouble is that 'Hot Plug' pci is a semi-standardized thing. That's why people are confused. :-) You want to plug in a new PCI bus, while most people consider hot-plug PCI a way to replace cards in a running system. : I looked in src/sys/dev/cardbus/cardbus_cis.c, and Linux's ACPI-based PCI : hotplug driver, and realised that at the lowest level, they are all in fact : pretty much doing the same thing -- that is, setting all bits in a BAR, and : then figuring out the desired aperture size for each BAR, allocating the : appropriate resources using rman, figuring out base addresses, etc. Yup. : We currently rely on the BIOS to do this. The bit I've been discussing with : Warner is how to deal with the problem of setting subordinate bus numbers, : though because I can get away without doing that for the 'pcib is an immediate : child of cardbus' case, I haven't done it. No we don't. We use what the BIOS provides, but will lazily allocate the BARs as necessary. We don't open the resource windows on the bridges, however. : I had also thought of passing down a 'cold' flag, for pcibX to indicate to : pciY that this is a 'cold attach' (the BIOS hasn't been anywhere near the : devices behind this bridge -- it is as fresh as after a RST# assert). I don't think that's a wise idea. Warner