PCI rerouting

From: Bjoern A. Zeeb <bzeeb-lists_at_lists.zabbadoz.net>
Date: Fri, 16 Jan 2004 20:25:56 +0000 (UTC)
Hi,

back last year I had trouble with some PCI rerouting:
http://lists.freebsd.org/pipermail/freebsd-current/2003-July/thread.html#7155

Noriyoshi Kawano came up with the attached patch but it hadn't been
committed because it was unknown why a kernel panic happens at boot
time.

Today I rebuilt a kernel from HEAD and still had trouble so the
tunable saved my weekend.

Can we somehow get this debugged and sorted out ?


--- compile-20040113-01/sys/dev/pci/pci.c.orig	Tue Jan 13 09:39:03 2004
+++ compile-20040113-01/sys/dev/pci/pci.c	Tue Jan 13 22:16:29 2004
_at__at_ -173,6 +173,12 _at__at_
 enable these bits correctly.  We'd like to do this all the time, but there\n\
 are some peripherals that this causes problems with.");

+static int pci_enable_rerouting = 1;
+TUNABLE_INT("hw.pci.enable_rerouting", (int *)&pci_enable_rerouting);
+SYSCTL_INT(_hw_pci, OID_AUTO, enable_rerouting, CTLFLAG_RW,
+    &pci_enable_rerouting, 1,
+    "Enable try to re-route interrupts.");
+
 /* Find a device_t by bus/slot/function */

 device_t
_at__at_ -817,6 +823,9 _at__at_

 	if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
 #if defined(__ia64__) || defined(__i386__) || defined(__amd64__)
+		if (!pci_enable_rerouting){
+			goto nottry;
+		}
 		/*
 		 * Try to re-route interrupts. Sometimes the BIOS or
 		 * firmware may leave bogus values in these registers.
_at__at_ -828,6 +837,7 _at__at_
 			pci_write_config(dev, PCIR_INTLINE, irq, 1);
 			cfg->intline = irq;
 		} else
+nottry:
 #endif
 			irq = cfg->intline;
 		resource_list_add(rl, SYS_RES_IRQ, 0, irq, irq, 1);

-- 
Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT
56 69 73 69 74				http://www.zabbadoz.net/
Received on Fri Jan 16 2004 - 11:30:14 UTC

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