Subject: testers wanted: poweredge / prioris users
To: None <port-i386@netbsd.org, current-users@netbsd.org>
From: Geoffrey Lee <glee@bluesat.unsw.edu.au>
List: current-users
Date: 08/18/2004 21:57:56
--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi all,


[ sending to both port-i386 and current-users in the hope to get
a wider audience. ]

I understand that some of the Dell PowerEdge and Digital Prioris have
problems with the IO/APIC not working correctly.  It works fine in UP
mode if you dont use the APIC but fails in MP mode (where the APIC is
mandatory) or in UP mode but utilizing the IO/APIC.

It seems that these machines have a hardware bug which causes the PCI
interrupts to be set to active high (yes I know that's wrong, but ...).
The cause as of now is unknown, but setting it to active high on the 
IO/APIC using ioapic_write() causes interrupts to function again
in IO/APIC mode.

I have attached a quick hack and I would like to seek help from the NetBSD
community who have such problem machines (UP or MP mode but with IO/APIC 
enabled) to test whether this patch fixes things for them.

We need to find a way to work around this, either as a compile time option
(something like IOAPIC_ACTLO_FIXUP) or maybe there something dynamic that
we can do in our interrupt handler glue.

I'll send-pr this too.

Thanks.


	-- geoff.
-- 
char p[] = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  "\x80\xe8\xdc\xff\xff\xff/bin/sh";

--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ioapic-fixup.diff"

Index: arch/x86/x86/ioapic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/ioapic.c,v
retrieving revision 1.8
diff -u -r1.8 ioapic.c
--- arch/x86/x86/ioapic.c	13 Feb 2004 11:36:20 -0000	1.8
+++ arch/x86/x86/ioapic.c	18 Aug 2004 11:53:56 -0000
@@ -354,7 +354,7 @@
 		ioapic_write(sc,IOAPIC_ID,
 		    (ioapic_read(sc,IOAPIC_ID)&~IOAPIC_ID_MASK)
 		    |(sc->sc_apicid<<IOAPIC_ID_SHIFT));
-		
+
 		apic_id = (ioapic_read(sc,IOAPIC_ID)&IOAPIC_ID_MASK)>>IOAPIC_ID_SHIFT;
 		
 		if (apic_id != sc->sc_apicid) {
@@ -419,11 +419,12 @@
 			redlo &= ~IOAPIC_REDLO_LEVEL;
 		if (map != NULL && ((map->flags & 3) == MPS_INTPO_DEF)) {
 			if (pp->ip_type == IST_LEVEL)
-				redlo |= IOAPIC_REDLO_ACTLO;
+				redlo &= ~IOAPIC_REDLO_ACTLO;
 			else
 				redlo &= ~IOAPIC_REDLO_ACTLO;
 		}
 	}
+
 	ioapic_write(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_write(sc, IOAPIC_REDHI(pin), redhi);
 	if (mp_verbose)

--envbJBWh7q8WU6mo--