Subject: CVS commit: [jmcneill-pm] src/sys
To: None <source-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@netbsd.org>
List: source-changes
Date: 09/30/2007 17:24:10
Module Name:	src
Committed By:	joerg
Date:		Sun Sep 30 17:24:10 UTC 2007

Modified Files:
	src/sys/arch/x86/x86 [jmcneill-pm]: ioapic.c
	src/sys/dev/acpi [jmcneill-pm]: acpi.c

Log Message:
Change ACPI and IOAPIC initialisation to better deal with early
interrupts.

(a) Split the ACPI subsystem initialisation into the hardware init and
ACPI enabling on the one side and the event and SCI setup on the other
side. Process the ACPI interrupt tables in between. Strictly speaking is
this a violation of the ACPI specs as the switch to APIC mode requires
evaluation of an ACPI object and that could depend on the SCI. In
practise, the SCI never worked at this point and before the removal of
the defered setup it wasn't even created.

(b) Always write entries to all IOAPIC pins. The first 16 pins are
threated as ISA IRQs by default, the others like PCI IRQs. This avoids
inconsistencies based on incomplete BIOS setups. This resulted in early
ACPI SCI notifications to be lost, effectively breaking the Embedded
Controller on cold start on many notebooks.

Don't special case the IOAPIC setup between ioapic_attach and
ioapic_enable, always setup the correct redirections. Depend on
splhigh/disable_intr to stop interrupts and don't keep them masked in the
IOAPIC. This avoids unacknowleged edge interrupts and fixing the problem
of broken PS/2 keyboard when hitting keys during early boot.


To generate a diff of this commit:
cvs rdiff -r1.19.8.4 -r1.19.8.5 src/sys/arch/x86/x86/ioapic.c
cvs rdiff -r1.101.16.15 -r1.101.16.16 src/sys/dev/acpi/acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.