Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Disable interrupts before returning from isr, and...



details:   https://anonhg.NetBSD.org/src/rev/ab40018d5c02
branches:  trunk
changeset: 823077:ab40018d5c02
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Apr 11 17:27:54 2017 +0000

description:
Disable interrupts before returning from isr, and re-enable them when the
soft interrupt handler returns. Fixes an interrupt storm on Tegra K1.
ok christos@

diffstat:

 sys/dev/ic/athn.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r b253af5ca9e0 -r ab40018d5c02 sys/dev/ic/athn.c
--- a/sys/dev/ic/athn.c Tue Apr 11 17:27:49 2017 +0000
+++ b/sys/dev/ic/athn.c Tue Apr 11 17:27:54 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athn.c,v 1.15 2017/02/02 10:05:35 nonaka Exp $ */
+/*     $NetBSD: athn.c,v 1.16 2017/04/11 17:27:54 jmcneill Exp $       */
 /*     $OpenBSD: athn.c,v 1.83 2014/07/22 13:12:11 mpi Exp $   */
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.15 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.16 2017/04/11 17:27:54 jmcneill Exp $");
 
 #ifndef _MODULE
 #include "athn_usb.h"          /* for NATHN_USB */
@@ -557,7 +557,12 @@
        if (!sc->sc_ops.intr_status(sc))
                return 0;
 
+       AR_WRITE(sc, AR_INTR_ASYNC_MASK, 0);
+       AR_WRITE(sc, AR_INTR_SYNC_MASK, 0);
+       AR_WRITE_BARRIER(sc);
+
        softint_schedule(sc->sc_soft_ih);
+
        return 1;
 }
 
@@ -578,6 +583,10 @@
                return;
 
        sc->sc_ops.intr(sc);
+
+       AR_WRITE(sc, AR_INTR_ASYNC_MASK, AR_INTR_MAC_IRQ);
+       AR_WRITE(sc, AR_INTR_SYNC_MASK, sc->sc_isync);
+       AR_WRITE_BARRIER(sc);
 }
 
 Static void



Home | Main Index | Thread Index | Old Index