Module Name:    src
Committed By:   msaitoh
Date:           Fri Jul 10 03:01:21 UTC 2015

Modified Files:
        src/sys/arch/x86/x86: mpbios.c

Log Message:
 Fix a problem that "Disable ACPI" doesn't work (PCI interrputs don't occur)
on some machines.

 On some machines' MPBIOS table, dest APIC IDs for PCI interrupts are not
IOAPIC's APIC ID. If we couldn't find an IOAPIC with ioapic_find(id), retry
with ioapic_find_bybase(pin). Tested with SuperMicro X10SLX-F.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/x86/x86/mpbios.c

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

Modified files:

Index: src/sys/arch/x86/x86/mpbios.c
diff -u src/sys/arch/x86/x86/mpbios.c:1.63 src/sys/arch/x86/x86/mpbios.c:1.64
--- src/sys/arch/x86/x86/mpbios.c:1.63	Wed Jun 24 11:09:26 2015
+++ src/sys/arch/x86/x86/mpbios.c	Fri Jul 10 03:01:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpbios.c,v 1.63 2015/06/24 11:09:26 msaitoh Exp $	*/
+/*	$NetBSD: mpbios.c,v 1.64 2015/07/10 03:01:21 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.63 2015/06/24 11:09:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.64 2015/07/10 03:01:21 msaitoh Exp $");
 
 #include "acpica.h"
 #include "lapic.h"
@@ -1313,8 +1313,25 @@ mpbios_int(const uint8_t *ent, int entty
 		sc = NULL;
 #endif
 		if (sc == NULL) {
-			printf("mpbios: can't find ioapic %d\n", id);
+#if NIOAPIC > 0
+			/*
+			 * If we couldn't find an ioapic by given id, retry to
+			 * get it by a pin number.
+			 */
+			sc = ioapic_find_bybase(pin);
+			if (sc == NULL) {
+				aprint_error("mpbios: can't find ioapic by"
+				    " neither apid(%d) nor pin number(%d)\n",
+				    id, pin);
+				return;
+			}
+			aprint_verbose("mpbios: use apid %d instead of %d\n",
+			    sc->sc_pic.pic_apicid, id);
+			id = sc->sc_pic.pic_apicid;
+#else
+			aprint_error("mpbios: can't find ioapic %d\n", id);
 			return;
+#endif
 		}
 
 		/*

Reply via email to