summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2017-08-09 15:10:39 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2017-08-09 15:10:39 +0000
commitfcfa635b0e3082faf86ac1b202484266b39daafe (patch)
treedeec84cd4eb228c5d931cd92dc0f2518520025c1
parent0bbd3a42cd2bb78fae6557c36771fb7a81d30393 (diff)
Clear any pending (edge-triggered) interrupts at setup to avoid
spurious interrupts with newly established handlers.
-rw-r--r--sys/arch/octeon/dev/octcit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/octeon/dev/octcit.c b/sys/arch/octeon/dev/octcit.c
index c8dfef9e928..72e5dbf35f3 100644
--- a/sys/arch/octeon/dev/octcit.c
+++ b/sys/arch/octeon/dev/octcit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octcit.c,v 1.1 2017/07/30 12:59:00 visa Exp $ */
+/* $OpenBSD: octcit.c,v 1.2 2017/08/09 15:10:38 visa Exp $ */
/*
* Copyright (c) 2017 Visa Hankala
@@ -160,10 +160,11 @@ octcit_attach(struct device *parent, struct device *self, void *aux)
for (hash = 0; hash < HASH_SIZE; hash++)
SLIST_INIT(&sc->sc_handlers[hash]);
- /* Disable all interrupts. */
+ /* Disable all interrupts and acknowledge any pending ones. */
for (intsn = 0; intsn < CIU3_NINTSN; intsn++) {
val = CIU3_RD_8(sc, CIU3_ISC_CTL(intsn));
if (ISSET(val, CIU3_ISC_CTL_IMP)) {
+ CIU3_WR_8(sc, CIU3_ISC_W1C(intsn), CIU3_ISC_CTL_RAW);
CIU3_WR_8(sc, CIU3_ISC_CTL(intsn), 0);
(void)CIU3_RD_8(sc, CIU3_ISC_CTL(intsn));
}