Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 1998 19:20:17 +0200
From:      Tor Egge <Tor.Egge@idi.ntnu.no>
To:        andreas@klemm.gtn.com
Cc:        smp@FreeBSD.ORG
Subject:   Re: SMP Problems
Message-ID:  <199804191720.TAA03652@pat.idi.ntnu.no>
In-Reply-To: Your message of "Sun, 19 Apr 1998 11:31:50 %2B0200"
References:  <19980419113150.60813@klemm.gtn.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sun, Apr 19, 1998 at 01:17:28AM +0200, Tor Egge wrote:
> > Try the following patch.
> > 
> > Index: mpapic.c
> > ===================================================================
> > RCS file: /home/ncvs/src/sys/i386/i386/mpapic.c,v
> > retrieving revision 1.29
> > diff -u -r1.29 mpapic.c
> > --- mpapic.c	1998/04/01 21:07:34	1.29
> > +++ mpapic.c	1998/04/18 23:12:31
> 
> Do you committ it ?

It might be reasonable to ignore the polarity/trigger-mode values in
the MP table if the APIC interrupt pin number corresponds to the
ISA/EISA interrupt number, since ISA/EISA interrupts are active-high
edge triggered interrupts when reaching the IOAPIC.

Thus, instead of

                        if ((bustype == ISA || bustype == EISA) &&
                            apic_polarity(apic, pin) != 0x3) {

the code could be

                        if ((bustype == ISA || bustype == EISA) &&
                            pin <= 15 && isa_apic_pin(pin) == pin) {

Thus an updated version of the patch is as follows:

Index: mpapic.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/mpapic.c,v
retrieving revision 1.29
diff -u -r1.29 mpapic.c
--- mpapic.c	1998/04/01 21:07:34	1.29
+++ mpapic.c	1998/04/19 17:00:35
@@ -164,7 +164,7 @@
 	if (apic == 0) {
 		maxpin = REDIRCNT_IOAPIC(apic);		/* pins in APIC */
 		for (pin = 0; pin < maxpin; ++pin) {
-			int bus;
+			int bus, bustype;
 
 			/* we only deal with vectored INTs here */
 			if (apic_int_type(apic, pin) != 0)
@@ -174,12 +174,22 @@
 			bus = apic_src_bus_id(apic, pin);
 			if (bus == -1)
 				continue;
+			bustype = apic_bus_type(bus);
 
-			flags = DEFAULT_FLAGS;
-			level = trigger(apic, pin, &flags);
-			if (level == 1)
-				apic_pin_trigger[apic] |= (1 << pin);
-			polarity(apic, pin, &flags, level);
+			/* the "ISA" type INTerrupts */
+			if ((bustype == ISA || bustype == EISA) &&
+			    pin <= 15 && isa_apic_pin(pin) == pin) {
+				flags = DEFAULT_ISA_FLAGS;
+			}
+
+			/* PCI or other bus */
+			else {
+				flags = DEFAULT_FLAGS;
+				level = trigger(apic, pin, &flags);
+				if (level == 1)
+					apic_pin_trigger[apic] |= (1 << pin);
+				polarity(apic, pin, &flags, level);
+			}
 
 			/* program the appropriate registers */
 			select = pin * 2 + IOAPIC_REDTBL0;	/* register */
 

- Tor Egge

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804191720.TAA03652>