cvs commit: src/sys/i386/pci pci_pir.c

John Baldwin jhb at FreeBSD.org
Thu Feb 19 11:23:34 PST 2004


On Thursday 19 February 2004 01:43 pm, Nate Lawson wrote:
> 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.

Yes, I have thought about adjusting the ACPI PCI link stuff to work the way 
$PIR does now (it's already fairly close).

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list