Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/arch/x86/x86 Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/e209748dec54
branches: netbsd-7
changeset: 799562:e209748dec54
user: snj <snj%NetBSD.org@localhost>
date: Tue Aug 11 05:07:16 2015 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #948):
sys/arch/x86/x86/mpacpi.c: revisions 1.99, 1.100
sys/arch/x86/x86/lapic.c: revision 1.49
- Add lapic_dump() to print lapic's setting.
- Add mpacpi_dump() to dump mp_intrs[].
--
Configure ioapic before lapic because lapic(lapic_set_lvt()) checks the
existence of ioapic. This change fixes a problem that some machines hang
after attaching ehci (little after writing EHCI_USBINTR to enable interrupt).
Even though cold == 1, LAPIC_LVINT0 was not set as masked. Perhaps it's the
reason of the problem.
This problem was observed on SuperMicro X10SLX-F, X10SDV-TLN4F and
Shuttle DS57U without wm(4) driver.
diffstat:
sys/arch/x86/x86/lapic.c | 37 +++++++++++++++++++++++--------------
sys/arch/x86/x86/mpacpi.c | 23 +++++++++++++++++++----
2 files changed, 42 insertions(+), 18 deletions(-)
diffs (134 lines):
diff -r 498788f85307 -r e209748dec54 sys/arch/x86/x86/lapic.c
--- a/sys/arch/x86/x86/lapic.c Sun Aug 09 10:16:35 2015 +0000
+++ b/sys/arch/x86/x86/lapic.c Tue Aug 11 05:07:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.47.4.1 2015/05/22 16:53:32 snj Exp $ */
+/* $NetBSD: lapic.c,v 1.47.4.2 2015/08/11 05:07:16 snj Exp $ */
/*-
* Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.47.4.1 2015/05/22 16:53:32 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.47.4.2 2015/08/11 05:07:16 snj Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -76,6 +76,8 @@
static void lapic_hwmask(struct pic *, int);
static void lapic_hwunmask(struct pic *, int);
static void lapic_setup(struct pic *, struct cpu_info *, int, int, int);
+/* Make it public to call via ddb */
+void lapic_dump(void);
struct pic local_pic = {
.pic_name = "lapic",
@@ -194,18 +196,8 @@
}
#ifdef MULTIPROCESSOR
- if (mp_verbose) {
- apic_format_redir (device_xname(ci->ci_dev), "timer", 0, 0,
- i82489_readreg(LAPIC_LVTT));
- apic_format_redir (device_xname(ci->ci_dev), "pcint", 0, 0,
- i82489_readreg(LAPIC_PCINT));
- apic_format_redir (device_xname(ci->ci_dev), "lint", 0, 0,
- i82489_readreg(LAPIC_LVINT0));
- apic_format_redir (device_xname(ci->ci_dev), "lint", 1, 0,
- i82489_readreg(LAPIC_LVINT1));
- apic_format_redir (device_xname(ci->ci_dev), "err", 0, 0,
- i82489_readreg(LAPIC_LVERR));
- }
+ if (mp_verbose)
+ lapic_dump();
#endif
}
@@ -616,3 +608,20 @@
int pin, int idtvec, int type)
{
}
+
+void
+lapic_dump(void)
+{
+ struct cpu_info *ci = curcpu();
+
+ apic_format_redir (device_xname(ci->ci_dev), "timer", 0, 0,
+ i82489_readreg(LAPIC_LVTT));
+ apic_format_redir (device_xname(ci->ci_dev), "pcint", 0, 0,
+ i82489_readreg(LAPIC_PCINT));
+ apic_format_redir (device_xname(ci->ci_dev), "lint", 0, 0,
+ i82489_readreg(LAPIC_LVINT0));
+ apic_format_redir (device_xname(ci->ci_dev), "lint", 1, 0,
+ i82489_readreg(LAPIC_LVINT1));
+ apic_format_redir (device_xname(ci->ci_dev), "err", 0, 0,
+ i82489_readreg(LAPIC_LVERR));
+}
diff -r 498788f85307 -r e209748dec54 sys/arch/x86/x86/mpacpi.c
--- a/sys/arch/x86/x86/mpacpi.c Sun Aug 09 10:16:35 2015 +0000
+++ b/sys/arch/x86/x86/mpacpi.c Tue Aug 11 05:07:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mpacpi.c,v 1.97 2013/03/25 01:30:37 chs Exp $ */
+/* $NetBSD: mpacpi.c,v 1.97.10.1 2015/08/11 05:07:16 snj Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,10 +36,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.97 2013/03/25 01:30:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.97.10.1 2015/08/11 05:07:16 snj Exp $");
#include "acpica.h"
#include "opt_acpi.h"
+#include "opt_ddb.h"
#include "opt_mpbios.h"
#include "opt_multiprocessor.h"
#include "pchb.h"
@@ -123,6 +124,10 @@
static void mpacpi_user_continue(const char *fmt, ...);
+#ifdef DDB
+void mpacpi_dump(void);
+#endif
+
int mpacpi_nioapic; /* number of ioapics */
int mpacpi_ncpu; /* number of cpus */
int mpacpi_nintsrc; /* number of non-device interrupts */
@@ -447,6 +452,8 @@
mpacpi_ncpu = mpacpi_nintsrc = mpacpi_nioapic = 0;
acpi_madt_walk(mpacpi_count, self);
+ acpi_madt_walk(mpacpi_config_ioapic, self);
+
#if NLAPIC > 0
lapic_boot_init(mpacpi_lapic_base);
#endif
@@ -456,8 +463,6 @@
if (mpacpi_ncpu == 0)
goto done;
- acpi_madt_walk(mpacpi_config_ioapic, self);
-
#if NPCI > 0
/*
* If PCI routing tables can't be built we report failure
@@ -1080,3 +1085,13 @@
printf("<press any key to continue>\n>");
cngetc();
}
+
+#ifdef DDB
+void
+mpacpi_dump(void)
+{
+ int i;
+ for (i = 0; i < mp_nintr; i++)
+ mpacpi_print_intr(&mp_intrs[i]);
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index