Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/pci If running in Qemu, don't report stray ed...



details:   https://anonhg.NetBSD.org/src/rev/2cfc2ef18744
branches:  trunk
changeset: 944444:2cfc2ef18744
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Sep 29 01:19:52 2020 +0000

description:
If running in Qemu, don't report stray edge-triggered ISA interrupts.
Works around an issue I obvserved with serial console in Qemu.

diffstat:

 sys/arch/alpha/pci/sio_pic.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 0912087183bb -r 2cfc2ef18744 sys/arch/alpha/pci/sio_pic.c
--- a/sys/arch/alpha/pci/sio_pic.c      Tue Sep 29 01:17:22 2020 +0000
+++ b/sys/arch/alpha/pci/sio_pic.c      Tue Sep 29 01:19:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sio_pic.c,v 1.45 2020/09/25 03:40:11 thorpej Exp $ */
+/* $NetBSD: sio_pic.c,v 1.46 2020/09/29 01:19:52 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.45 2020/09/25 03:40:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.46 2020/09/29 01:19:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,6 +68,7 @@
 #include <sys/cpu.h>
 #include <sys/syslog.h>
 
+#include <machine/alpha.h>
 #include <machine/intr.h>
 #include <sys/bus.h>
 
@@ -463,6 +464,16 @@
                scb_set(0x800 + SCB_IDXTOVEC(irq), sio_iointr, NULL);
                sio_setirqstat(irq, 1,
                    alpha_shared_intr_get_sharetype(sio_intr, irq));
+
+               /*
+                * I've obsesrved stray ISA interrupts when interacting
+                * with the serial console under Qemu.  Work around that
+                * for now by suppressing stray interrupt reporting for
+                * edge-triggered interrupts.
+                */
+               if (alpha_is_qemu && type == IST_EDGE) {
+                       alpha_shared_intr_set_maxstrays(sio_intr, irq, 0);
+               }
        }
 
        mutex_exit(&cpu_lock);
@@ -508,6 +519,7 @@
                }
                sio_setirqstat(irq, 0, ist);
                alpha_shared_intr_set_dfltsharetype(sio_intr, irq, ist);
+               alpha_shared_intr_set_maxstrays(sio_intr, irq, STRAY_MAX);
 
                /* Release our SCB vector. */
                scb_free(0x800 + SCB_IDXTOVEC(irq));



Home | Main Index | Thread Index | Old Index