Re: is there a way not to believe the bios' IRQ prog and use the $PIR?

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 11 Jul 2005 14:38:07 -0400
On Monday 11 July 2005 12:17 pm, othermark wrote:
> Hi,
>
> I believe since the following commit, I have had serious problems with
> interrupts on one class of machines (TYAN S1867 - thunder 2500):
>
> http://article.gmane.org/gmane.os.freebsd.devel.cvs.src/46247/
>
> jhb         2005-04-14 18:25:09 UTC
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/i386/pci         pci_pir.c
>   Log:
>   Trust the settings programmed by the BIOS over what the $PIR says.
>   Specifically, if the BIOS has programmed an IRQ for a device that doesn't
>   match the list of valid IRQs for the link, use it anyway as some BIOSes
>   don't correctly list the valid IRQs in the $PIR.  Also, allow the user
>   to specify an IRQ that $PIR claims is invalid as an override, but emit a
>   warning in that case.
>
>   Revision  Changes    Path
>   1.117     +48 -18    src/sys/i386/pci/pci_pir.c
>
> Unfortunately, I'm quite sure that no more fixes for this older
> mboard will be forthcoming from the vendor.   Under high to moderate
> load, the layer will simply 'miss' interrupts, leading to file/network
> traffic corruption and dropped characters on serial consoles.
>
> Here's the non -v boot showing the warning entries.
>
> pcib2: <ServerWorks host to PCI bridge> pcibus 2 on motherboard
> pir0: <PCI Interrupt Routing Table: 12 Entries> on motherboard
> $PIR: Using invalid BIOS IRQ 17 from 1.0.INTA is for link 0x12
> $PIR: Using invalid BIOS IRQ 23 from 0.7.INTA is for link 0x18
> $PIR: Using invalid BIOS IRQ 16 from 0.3.INTA is for link 0x11
> $PIR: Using invalid BIOS IRQ 18 from 0.4.INTA is for link 0x13
> $PIR: Using invalid BIOS IRQ 20 from 0.5.INTA is for link 0x15
> $PIR: Using invalid BIOS IRQ 22 from 0.6.INTA is for link 0x17
>
> Is there a tunable I'm not aware of that I could revert back to
> not believing the BIOS and use the $PIR entries?

You can override the IRQs for any link device by setting 
hw.pci.link.0x12.irq=XX to set link 0x12 to irq XX for example.  You could 
also modify $PIR to never trust a BIOS value > 16:

--- //depot/vendor/freebsd/src/sys/i386/pci/pci_pir.c	2005/04/14 18:25:24
+++ //depot/user/jhb/acpipci/i386/pci/pci_pir.c	2005/07/11 18:13:16
_at__at_ -327,6 +327,15 _at__at_
 	if (irq == PCI_INVALID_IRQ || irq == pci_link->pl_irq)
 		return;
 
+	/* Don't trust any BIOS IRQs greater than 15. */
+	if (irq >= NUM_ISA_INTERRUPTS) {
+		printf(
+	"$PIR: Ignoring invalid BIOS IRQ %d from %d.%d.INT%c for link %#x\n",
+		    irq, entry->pe_bus, entry->pe_device, pin + 'A',
+		    pci_link->pl_id);
+		return;
+	}
+
 	/*
 	 * If we don't have an IRQ for this link yet, then we trust the
 	 * BIOS, even if it seems invalid from the $PIR entries.
_at__at_ -334,7 +343,7 _at__at_
 	if (pci_link->pl_irq == PCI_INVALID_IRQ) {
 		if (!pci_pir_valid_irq(pci_link, irq))
 			printf(
-	"$PIR: Using invalid BIOS IRQ %d from %d.%d.INT%c is for link %#x\n",
+	"$PIR: Using invalid BIOS IRQ %d from %d.%d.INT%c for link %#x\n",
 			    irq, entry->pe_bus, entry->pe_device, pin + 'A',
 			    pci_link->pl_id);
 		pci_link->pl_irq = irq;

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Mon Jul 11 2005 - 16:38:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:38 UTC