From owner-cvs-src@FreeBSD.ORG Thu Feb 19 10:43:25 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 854A616A4D0 for ; Thu, 19 Feb 2004 10:43:25 -0800 (PST) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 650F343D2D for ; Thu, 19 Feb 2004 10:43:25 -0800 (PST) (envelope-from nate@root.org) Received: (qmail 41901 invoked by uid 1000); 19 Feb 2004 18:43:26 -0000 Date: Thu, 19 Feb 2004 10:43:26 -0800 (PST) From: Nate Lawson To: John Baldwin In-Reply-To: <20040218224027.4992016A4DA@hub.freebsd.org> Message-ID: <20040219104132.G41856@root.org> References: <20040218224027.4992016A4DA@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/pci pci_pir.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2004 18:43:25 -0000 On Wed, 18 Feb 2004, John Baldwin wrote: > Modified files: > sys/i386/pci pci_pir.c > Log: > Rework the $PIR (aka PCIBIOS) PCI interrupt routing code and split it off > into its own file: > - All of the $PIR interrupt routing is now done in a link-centric fashion. > When a host-PCI bridge that uses the $PIR attaches, it calls pir_parse() > to parse the table. This scans for link devices and merges all the masks > for each link device from the table entries. It then looks at the intline > register of PCI devices connected to a link to figure out if the BIOS has > routed this link and if so to which IRQ. > - The IRQ for any given link can be overridden via a hint like so: > 'hw.pci.link.0x62.irq=10' Any IRQ set in this matter is treated as if it > were set that way by the BIOS. > - We only call the BIOS to route each link device once. > - When a PCI device wants to route an interrupt, we look it up in the $PIR > to find the associated link. If the link is routed, we simply return the > IRQ it is using. If it is not routed, we have to pick one. This uses a > different algorithm from the old code. First off, when we try to pick > an interrupt from a mask of possible interrupts, we try to pick the one > that is least loaded as far as PCI devices. We maintain this weight based > on the number of devices attached to each link device. When choosing an > IRQ, we first attempt to route using any PCI only interrupts (the old > code did this as well). If that doesn't work, we try to use the list of > IRQs that the BIOS has used. This is a new step that the new code didn't > do and avoids using IRQ 3 or 4 for every virgin interrupt routing. If > none of the IRQs that the BIOS used worked, then we fall back to trying > anything. > - The fallback mask for !PC98 was fixed to include IRQ 3 and not allow IRQ > 2. > - We don't use the $PIR to route interrupts on a PCI-PCI bridge unless it > has already been used to route on at least one Host-PCI bridge. This > helps to avoid mixing and matching x86 firmware PCI interrupt routing > methods (which is a Bad Thing(tm)). > > Silence on: current@ > > Revision Changes Path > 1.109 +447 -611 src/sys/i386/pci/pci_pir.c This is great! Care to look at cleaning up the ACPI _PRT routing? I believe it prefers 3-4 initially for many common BIOSen too. -Nate