Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Fix a problem that "Disable ACPI" doesn't w...



details:   https://anonhg.NetBSD.org/src/rev/936931c1f975
branches:  trunk
changeset: 809426:936931c1f975
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 10 03:01:21 2015 +0000

description:
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.

diffstat:

 sys/arch/x86/x86/mpbios.c |  23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 9a50cc0fe6c3 -r 936931c1f975 sys/arch/x86/x86/mpbios.c
--- a/sys/arch/x86/x86/mpbios.c Thu Jul 09 18:19:34 2015 +0000
+++ b/sys/arch/x86/x86/mpbios.c Fri Jul 10 03:01:21 2015 +0000
@@ -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 @@
                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
                }
 
                /*



Home | Main Index | Thread Index | Old Index