aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2020-09-20 16:11:38 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2020-09-20 16:11:38 +0000
commit1c62664f24670f5d07bfca353dcb5107eba1b168 (patch)
treefcbd1871239e01a79c7fbe8092fcf5972bd856e2
parent3182062142ede29460c137b03b4bf6548292ec2d (diff)
downloadsrc-1c62664f24670f5d07bfca353dcb5107eba1b168.tar.gz
src-1c62664f24670f5d07bfca353dcb5107eba1b168.zip
arm: allwinner: aw_nmi: Fix wrong logic when we disable the nmi
MFC after: 1 week
Notes
Notes: svn path=/head/; revision=365927
-rw-r--r--sys/arm/allwinner/aw_nmi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arm/allwinner/aw_nmi.c b/sys/arm/allwinner/aw_nmi.c
index 6687d37c6328..d242726c29b9 100644
--- a/sys/arm/allwinner/aw_nmi.c
+++ b/sys/arm/allwinner/aw_nmi.c
@@ -129,7 +129,7 @@ aw_nmi_intr(void *arg)
}
if (intr_isrc_dispatch(&sc->intr.isrc, curthread->td_intr_frame) != 0) {
- SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+ SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
device_printf(sc->dev, "Stray interrupt, NMI disabled\n");
}
@@ -153,7 +153,7 @@ aw_nmi_disable_intr(device_t dev, struct intr_irqsrc *isrc)
sc = device_get_softc(dev);
- SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+ SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
}
static int
@@ -296,7 +296,7 @@ aw_nmi_teardown_intr(device_t dev, struct intr_irqsrc *isrc,
sc->intr.pol = INTR_POLARITY_CONFORM;
sc->intr.tri = INTR_TRIGGER_CONFORM;
- SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+ SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
}
return (0);
@@ -367,7 +367,7 @@ aw_nmi_attach(device_t dev)
}
/* Disable and clear interrupts */
- SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+ SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK);
xref = OF_xref_from_node(ofw_bus_get_node(dev));