summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2013-10-05 22:59:57 +0000
committerkettenis <kettenis@openbsd.org>2013-10-05 22:59:57 +0000
commitd20caac4733abf70aa1995d35091e8a45bf3dcbc (patch)
tree0bb78d4ae843a725884fd33f02c19e5054c471b6 /sys
parentCleanup suggested by gcc-4.8.1, following hints by Christos Zoulas: (diff)
downloadwireguard-openbsd-d20caac4733abf70aa1995d35091e8a45bf3dcbc.tar.xz
wireguard-openbsd-d20caac4733abf70aa1995d35091e8a45bf3dcbc.zip
Disable interrupts in the interrupt handler. This is what FreeBSD does, and
it seems to fix the occasional watchdog timeout when using MSI. tested by many
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/re.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index a0e30102328..5af3e80cefd 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.143 2013/08/07 01:06:30 bluhm Exp $ */
+/* $OpenBSD: re.c,v 1.144 2013/10/05 22:59:57 kettenis Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1650,6 +1650,9 @@ re_intr(void *arg)
if (!(ifp->if_flags & IFF_RUNNING))
return (0);
+ /* Disable interrupts. */
+ CSR_WRITE_2(sc, RL_IMR, 0);
+
rx = tx = 0;
status = CSR_READ_2(sc, RL_ISR);
/* If the card has gone away the read returns 0xffff. */
@@ -1716,6 +1719,8 @@ re_intr(void *arg)
if (tx && !IFQ_IS_EMPTY(&ifp->if_snd))
re_start(ifp);
+ CSR_WRITE_2(sc, RL_IMR, sc->rl_intrs);
+
return (claimed);
}