Re: [PATCH] interrupt problem with MPS 1.4 / not with MPS 1.1 ?

2001-06-02 Thread thunder7

On Sat, Jun 02, 2001 at 03:41:08AM -0400, Jeff Garzik wrote:
> > No, I'm afraid it doesn't :-(
> > 
> Thanks for testing.
> 
> Ok, how about this one?  This is a more simple version of the logic
> presented, which should give you the value that Manfred asked you plug
> in manually.
> 
No go, I'm afraid. I wonder why I do see the

PCI: Disabling Via external APIC routing

messages, but none of the 

PCI: Via IRQ fixup ...

messages that I assume should have been printed

Greetings,
Jurriaan

Total of 2 processors activated (2808.21 BogoMIPS).
ENABLING IO-APIC IRQs
...changing IO-APIC physical APIC ID to 2 ... ok.
init IO_APIC IRQs
 IO-APIC (apicid-pin) 2-0, 2-5, 2-10, 2-11, 2-15, 2-20, 2-21, 2-22, 2-23 not connected.
..TIMER: vector=49 pin1=2 pin2=0
number of MP IRQ sources: 22.
number of IO-APIC #2 registers: 24.
testing the IO APIC...

IO APIC #2..
 register #00: 0200
...: physical APIC id: 02
 register #01: 00178011
... : max redirection entries: 0017
... : IO APIC version: 0011
 WARNING: unexpected IO-APIC, please mail
  to [EMAIL PROTECTED]
 register #02: 
... : arbitration: 00
 IRQ redirection table:
 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   
 00 000 00  100   0   00000
 01 003 03  000   0   01139
 02 003 03  000   0   01131
 03 003 03  000   0   01141
 04 003 03  000   0   01149
 05 000 00  100   0   00000
 06 003 03  000   0   01151
 07 003 03  000   0   01159
 08 003 03  000   0   01161
 09 003 03  000   0   01169
 0a 000 00  100   0   00000
 0b 000 00  100   0   00000
 0c 003 03  000   0   01171
 0d 003 03  000   0   01179
 0e 003 03  000   0   01181
 0f 000 00  100   0   00000
 10 003 03  110   1   01189
 11 003 03  110   1   01191
 12 003 03  110   1   01199
 13 003 03  110   1   011A1
 14 000 00  100   0   00000
 15 000 00  100   0   00000
 16 000 00  100   0   00000
 17 000 00  100   0   00000
IRQ to pin mappings:
IRQ0 -> 0:2
IRQ1 -> 0:1
IRQ3 -> 0:3
IRQ4 -> 0:4
IRQ6 -> 0:6
IRQ7 -> 0:7
IRQ8 -> 0:8
IRQ9 -> 0:9
IRQ12 -> 0:12
IRQ13 -> 0:13
IRQ14 -> 0:14
IRQ16 -> 0:16
IRQ17 -> 0:17
IRQ18 -> 0:18
IRQ19 -> 0:19
 done.
Using local APIC timer interrupts.
calibrating APIC timer ...
. CPU clock speed is 703.1867 MHz.
. host bus clock speed is 100.4552 MHz.
cpu: 0, clocks: 1004552, slice: 334850
PCI: Probing PCI hardware
Unknown bridge resource 0: assuming transparent
Unknown bridge resource 2: assuming transparent
PCI: Using IRQ router VIA [1106/0686] at 00:07.0
PCI->APIC IRQ transform: (B0,I7,P3) -> 19
PCI->APIC IRQ transform: (B0,I7,P3) -> 19
PCI->APIC IRQ transform: (B0,I10,P0) -> 17
PCI->APIC IRQ transform: (B0,I11,P0) -> 17
PCI->APIC IRQ transform: (B0,I14,P0) -> 18
PCI->APIC IRQ transform: (B1,I0,P0) -> 16
PCI->APIC IRQ transform: (B2,I0,P0) -> 16
PCI->APIC IRQ transform: (B2,I1,P0) -> 17
PCI->APIC IRQ transform: (B2,I2,P0) -> 18
PCI: Disabling Via external APIC routing
Linux NET4.0 for Linux 2.4
i2c-core.o: adapter MAVEN:fb0 on i2c-matroxfb registered as adapter 2.
usb.c: registered new driver hub
uhci.c: USB UHCI at I/O 0xa000, IRQ 19
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c: USB UHCI at I/O 0xa400, IRQ 19
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c:  Linus Torvalds, Johannes Erdfelt, Randy Dunlap, Georg Acher, Deti Fliegl, 
Thomas Sailer, Roman Weissgaerber
uhci.c: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
NET4: Linux TCP/IP 1.0 for NET4.0
hub.c: USB new device connect on bus1/1, assigned device number 2
usb_control/bulk_msg: timeout
usb.c: USB device not accepting new address=2 (error=-110)
hub.c: USB new device connect on bus1/1, assigned device number 3
reiserfs: checking transaction log (device 03:0a) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 21:04) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
usb_control/bulk_msg: timeout
usb.c: USB device not accepting new address=3 (error=-110)
reiserfs: checking transaction log (device 22:03) ...
Using r5 hash to sort names

   CPU0   CPU1   
  0:   4964   8776IO-APIC-edge  timer
  1: 33 34IO-APIC-edge  keyboard
  2:  0  0  XT-PIC  cascade
  8:  

[PATCH] interrupt problem with MPS 1.4 / not with MPS 1.1 ?

2001-06-02 Thread Jeff Garzik

> On Fri, Jun 01, 2001 at 04:42:40PM -0400, Jeff Garzik wrote:
> > Does this patch fix things for you, such that MPS 1.1 and MPS 1.4 both
> > work?
> 
> No, I'm afraid it doesn't :-(
> 
> Here are the dmesg (with some info cut out for brevity), the
> /proc/interrupts and the lspci -vvvxxx from a 2.4.5-ac6 kernel with this
> patch. I see in the dmesg the patch is active, but still I get:


Thanks for testing.

Ok, how about this one?  This is a more simple version of the logic
presented, which should give you the value that Manfred asked you plug
in manually.

-- 
Jeff Garzik  | Disbelief, that's why you fail.
Building 1024|
MandrakeSoft |

diff -urN linux-2.4.5/drivers/pci/quirks.c linux.viairq/drivers/pci/quirks.c
--- linux-2.4.5/drivers/pci/quirks.cSat May 19 20:43:06 2001
+++ linux.viairq/drivers/pci/quirks.c   Sat Jun  2 03:38:48 2001
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #undef DEBUG
 
@@ -267,6 +268,8 @@
 /*
  * VIA 686A/B: If an IO-APIC is active, we need to route all on-chip
  * devices to the external APIC.
+ *
+ * TODO: this should be done at IRQ assign time (pci_enable_device call)
  */
 static void __init quirk_via_ioapic(struct pci_dev *dev)
 {
@@ -277,6 +280,9 @@
else
tmp = 0x1f; /* all known bits (4-0) routed to external APIC */

+   printk(KERN_INFO "PCI: %sbling Via external APIC routing\n",
+  tmp ? "Disa" : "Ena");
+
/* Offset 0x58: External APIC IRQ output control */
pci_write_config_byte (dev, 0x58, tmp);
 }
@@ -285,6 +291,34 @@
 
 
 /*
+ * Via 686A/B:  The PCI_INTERRUPT_LINE register for the on-chip
+ * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
+ * when written, it makes an internal connection to the PIC.
+ * For these devices, this register is defined to be 4 bits wide.
+ * Normally this is fine.  However for IO-APIC motherboards, or
+ * non-x86 architectures (yes Via exists on PPC among other places),
+ * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
+ * interrupts delivered properly.
+ *
+ * TODO: this should be done at IRQ assign time (pci_enable_device call)
+ */
+static void __init quirk_via_irqpic(struct pci_dev *dev)
+{
+   u8 irq, new_irq;
+
+   pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
+   new_irq = irq & 0xf;
+   if (new_irq != irq) {
+   printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
+  dev->slot_name, irq, new_irq);
+
+   udelay(15);
+   pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
+   }
+}
+
+
+/*
  * PIIX3 USB: We have to disable USB interrupts that are
  * hardwired to PIRQD# and may be shared with an
  * external device.
@@ -372,6 +406,11 @@
 #ifdef CONFIG_X86_IO_APIC 
{ PCI_FIXUP_FINAL,  PCI_VENDOR_ID_VIA,  PCI_DEVICE_ID_VIA_82C686,  
 quirk_via_ioapic },
 #endif
+
+   { PCI_FIXUP_FINAL,  PCI_VENDOR_ID_VIA,  PCI_DEVICE_ID_VIA_82C586_2,
+ quirk_via_irqpic },
+   { PCI_FIXUP_FINAL,  PCI_VENDOR_ID_VIA,  PCI_DEVICE_ID_VIA_82C686_4,
+ quirk_via_irqpic },
+   { PCI_FIXUP_FINAL,  PCI_VENDOR_ID_VIA,  PCI_DEVICE_ID_VIA_82C686_5,
+ quirk_via_irqpic },
+   { PCI_FIXUP_FINAL,  PCI_VENDOR_ID_VIA,  PCI_DEVICE_ID_VIA_82C686_6,
+ quirk_via_irqpic },
 
{ 0 }
 };
diff -urN linux-2.4.5/drivers/sound/via82cxxx_audio.c 
linux.viairq/drivers/sound/via82cxxx_audio.c
--- linux-2.4.5/drivers/sound/via82cxxx_audio.c Tue May  1 19:05:00 2001
+++ linux.viairq/drivers/sound/via82cxxx_audio.cFri Jun  1 16:32:25 2001
@@ -3012,7 +3012,6 @@
 {
int rc;
struct via_info *card;
-   u8 tmp;
static int printed_version = 0;
 
DPRINTK ("ENTER\n");
@@ -3107,19 +3106,6 @@
if (rc) {
printk (KERN_ERR PFX "interrupt init failed, aborting\n");
goto err_out_have_proc;
-   }
-
-   pci_read_config_byte (pdev, 0x3C, &tmp);
-   if ((tmp & 0x0F) != pdev->irq) {
-   printk (KERN_WARNING PFX "IRQ fixup, 0x3C==0x%02X\n", tmp);
-   udelay (15);
-   tmp &= 0xF0;
-   tmp |= pdev->irq;
-   pci_write_config_byte (pdev, 0x3C, tmp);
-   DPRINTK ("new 0x3c==0x%02x\n", tmp);
-   } else {
-   DPRINTK ("IRQ reg 0x3c==0x%02x, irq==%d\n",
-   tmp, tmp & 0x0F);
}
 
printk (KERN_INFO PFX "board #%d at 0x%04lX, IRQ %d\n",



Re: [PATCH] interrupt problem with MPS 1.4 / not with MPS 1.1 ?

2001-06-01 Thread thunder7

On Fri, Jun 01, 2001 at 04:42:40PM -0400, Jeff Garzik wrote:
> Does this patch fix things for you, such that MPS 1.1 and MPS 1.4 both
> work?

No, I'm afraid it doesn't :-(

Here are the dmesg (with some info cut out for brevity), the
/proc/interrupts and the lspci -vvvxxx from a 2.4.5-ac6 kernel with this
patch. I see in the dmesg the patch is active, but still I get:

usb.c: registered new driver hub
usb.c: new USB bus registered, assigned bus number 1
usb.c: new USB bus registered, assigned bus number 2
usb.c: registered new driver usb-storage
usb_control/bulk_msg: timeout
usb.c: USB device not accepting new address=2 (error=-110)
usb_control/bulk_msg: timeout
usb.c: USB device not accepting new address=3 (error=-110)

Good luck,
Jurriaan


D APIC at: 0xFEE0
Processor #0 Pentium(tm) Pro APIC version 17
Processor #1 Pentium(tm) Pro APIC version 17
I/O APIC #2 Version 17 at 0xFEC0.
Processors: 2
Kernel command line: auto BOOT_IMAGE=SuSE-2.4.5ac6 ro root=2101 
BOOT_FILE=/boot/prod/vmlinuz-245ac6 video=matrox:vesa:0x11E,fv:80,sgram
Initializing CPU#0
Detected 703.169 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 1402.47 BogoMIPS

Total of 2 processors activated (2808.21 BogoMIPS).
ENABLING IO-APIC IRQs
...changing IO-APIC physical APIC ID to 2 ... ok.
init IO_APIC IRQs
 IO-APIC (apicid-pin) 2-0, 2-5, 2-10, 2-11, 2-15, 2-20, 2-21, 2-22, 2-23 not connected.
..TIMER: vector=49 pin1=2 pin2=0
number of MP IRQ sources: 22.
number of IO-APIC #2 registers: 24.
testing the IO APIC...

IO APIC #2..
 register #00: 0200
...: physical APIC id: 02
 register #01: 00178011
... : max redirection entries: 0017
... : IO APIC version: 0011
 WARNING: unexpected IO-APIC, please mail
  to [EMAIL PROTECTED]
 register #02: 
... : arbitration: 00
 IRQ redirection table:
 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   
 00 000 00  100   0   00000
 01 003 03  000   0   01139
 02 003 03  000   0   01131
 03 003 03  000   0   01141
 04 003 03  000   0   01149
 05 000 00  100   0   00000
 06 003 03  000   0   01151
 07 003 03  000   0   01159
 08 003 03  000   0   01161
 09 003 03  000   0   01169
 0a 000 00  100   0   00000
 0b 000 00  100   0   00000
 0c 003 03  000   0   01171
 0d 003 03  000   0   01179
 0e 003 03  000   0   01181
 0f 000 00  100   0   00000
 10 003 03  110   1   01189
 11 003 03  110   1   01191
 12 003 03  110   1   01199
 13 003 03  110   1   011A1
 14 000 00  100   0   00000
 15 000 00  100   0   00000
 16 000 00  100   0   00000
 17 000 00  100   0   00000
IRQ to pin mappings:
IRQ0 -> 0:2
IRQ1 -> 0:1
IRQ3 -> 0:3
IRQ4 -> 0:4
IRQ6 -> 0:6
IRQ7 -> 0:7
IRQ8 -> 0:8
IRQ9 -> 0:9
IRQ12 -> 0:12
IRQ13 -> 0:13
IRQ14 -> 0:14
IRQ16 -> 0:16
IRQ17 -> 0:17
IRQ18 -> 0:18
IRQ19 -> 0:19
 done.
Using local APIC timer interrupts.
calibrating APIC timer ...
. CPU clock speed is 703.0694 MHz.
. host bus clock speed is 100.4384 MHz.
cpu: 0, clocks: 1004384, slice: 334794
CPU0
cpu: 1, clocks: 1004384, slice: 334794
CPU1
checking TSC synchronization across CPUs: passed.
mtrr: your CPUs had inconsistent fixed MTRR settings
mtrr: your CPUs had inconsistent variable MTRR settings
mtrr: probably your BIOS does not setup all CPUs
PCI: PCI BIOS revision 2.10 entry at 0xfb3a0, last bus=2
PCI: Using configuration type 1
PCI: Probing PCI hardware
Unknown bridge resource 0: assuming transparent
Unknown bridge resource 2: assuming transparent
PCI: Using IRQ router VIA [1106/0686] at 00:07.0
PCI->APIC IRQ transform: (B0,I7,P3) -> 19
PCI->APIC IRQ transform: (B0,I7,P3) -> 19
PCI->APIC IRQ transform: (B0,I10,P0) -> 17
PCI->APIC IRQ transform: (B0,I11,P0) -> 17
PCI->APIC IRQ transform: (B0,I14,P0) -> 18
PCI->APIC IRQ transform: (B1,I0,P0) -> 16
PCI->APIC IRQ transform: (B2,I0,P0) -> 16
PCI->APIC IRQ transform: (B2,I1,P0) -> 17
PCI->APIC IRQ transform: (B2,I2,P0) -> 18
PCI: Setting Via APIC control
PCI: Via IRQ fixup for 00:07.2, from 5 to 19
PCI: Via IRQ fixup for 00:07.3, from 5 to 19
PCI: Via IRQ fixup for 00:07.4, from 0 to 3
Linux NET4.0 for Linux 2.4

i2c-core.o: adapter MAVEN:fb0 on i2c-matroxfb registered as adapter 2.
usb.c: registered new driver hub
uhci.c: USB UHCI at I/O 0xa000, IRQ 19
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c: USB UHCI at I/O 0xa400, IRQ 19
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hu