diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-08-09 15:10:39 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-08-09 15:10:39 +0000 |
commit | fcfa635b0e3082faf86ac1b202484266b39daafe (patch) | |
tree | deec84cd4eb228c5d931cd92dc0f2518520025c1 /sys/arch | |
parent | 0bbd3a42cd2bb78fae6557c36771fb7a81d30393 (diff) |
Clear any pending (edge-triggered) interrupts at setup to avoid
spurious interrupts with newly established handlers.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/octeon/dev/octcit.c | 5 |
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)); } |