Subject: port-i386/25193: ACPI SCI does not work with PCIBIOS_INTR_FIXUP on Libretto L3
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <kanaoka@ann.hi-ho.ne.jp>
List: netbsd-bugs
Date: 04/15/2004 14:40:43
>Number:         25193
>Category:       port-i386
>Synopsis:       ACPI SCI does not work with PCIBIOS_INTR_FIXUP on Libretto L3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 15 14:41:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Masanori Kanaoka
>Release:        NetBSD-cuurent/i386
>Organization:
>Environment:
NetBSD idea.k.vnop.net 2.0C NetBSD 2.0C (IDEA) #1: Tue Apr 13 01:31:51 JST 2004  root@idea.k.vnop.net:/usr/src/sys/arch/i386/compile/IDEA i386

>Description:
 - ACPI SCI notify acpi event.it need to set level trigger.

 - On assumption that Not PCI is equal to ISA, PCIBIOS_INTR_FIXUP set edge/level trigger.
   If SCI does not shared interrupt with PCI, PCIBIOS_INTR_FIXUP set edge trigger
   to SCI.

 - PCIBIOS_INTR_FIXUP execute before ACPI configuration.

 - ACPI configuration does not set level trigger to SCI. 

On My Libretto L3, SCI does not share interrupt with PCI, PCIBIOS_INTR_FIXUP 
set edge trigger to SCI. Thus it does not work. it does not notify acpi event.
 
>How-To-Repeat:
On libretto L3/L2, 
 1. enable acpi and PCIBIOS stuff (include PCIBIOS_INTR_FIXUP) in config file.
 2. make kernel and test it.
>Fix:
I found two workarounds:

 1. Use ACPI_PCI_FIXUP instead of PCIBIOS_INTR_FIXUP.
 2. Apply next patch against pci_intr_fixup.c

diff -x IDEA -x CVS -uraN src.orig/sys/arch/i386/pci/pci_intr_fixup.c src/sys/arch/i386/pci/pci_int
r_fixup.c
--- src.orig/sys/arch/i386/pci/pci_intr_fixup.c 2004-04-11 15:00:26.000000000 +0900
+++ src/sys/arch/i386/pci/pci_intr_fixup.c      2004-04-15 16:30:26.000000000 +0900
@@ -577,9 +577,9 @@
        int i, bit;

        for (i = 0, bit = 1; i < 16; i++, bit <<= 1) {
-               if ((*pciirq & bit) == 0)
+               if (*pciirq & bit)
                        (void) pciintr_icu_set_trigger(pciintr_icu_tag,
-                           pciintr_icu_handle, i, IST_EDGE);
+                           pciintr_icu_handle, i, IST_LEVEL);
        }

        return (0);

But they are workarounds,I think.

I think that ACPI configuration should set level trigger(of course, other setting) 
to SCI by itself.

Sorry, That is beyond my skill.

>Release-Note:
>Audit-Trail:
>Unformatted: