summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-10-17 10:39:01 +0000
committerriastradh <riastradh@NetBSD.org>2022-10-17 10:39:01 +0000
commit7e665b231ceb5482c0cc4b2c6d313099bea9b145 (patch)
tree884e3ad002313aa253a18e8a058f928d80c1d877 /sys/dev
parentaf82fb8f7eb226cdb879ceed4a0c9a7127549757 (diff)
aq(4): Unconditionally halt callout in aq_stop.
Fixes panic with callout still running on detach after we destroy the lock, reported by andvar@: fatal page fault in supervisor mode trap type 6 code 0 rip 0xffffffff80dfafec cs 0x8 rflags 0x10286 cr2 0xfffffffffffffff0 ilevel 0x2 rsp 0xffffcd085b291ee0 Skipping crash dump on recursive panic panic: trap cpu0: Begin traceback... vpanic() at netbsd:vpanic+0x183 panic() at netbsd:panic+0x3c trap() at netbsd:trap+0xb27 --- trap (number 6) --- mutex_oncpu() at netbsd:mutex_oncpu+0x1e mutex_vector_enter() at netbsd:mutex_vector_enter+0xb7 aq_tick() at netbsd:aq_tick+0x23 callout_softclock() at netbsd:callout_softclock+0xbd softint_dispatch() at netbsd:softint_dispatch+0xf9 DDB lost frame for netbsd:Xsoftintr+0x4c, trying 0xffffcd085b2920f0 Xsoftintr() at netbsd:Xsoftintr+0x4c --- interrupt --- fa0b2181724b21c1: cpu0: End traceback...
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_aq.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/pci/if_aq.c b/sys/dev/pci/if_aq.c
index 725cb11c816..e497fb15608 100644
--- a/sys/dev/pci/if_aq.c
+++ b/sys/dev/pci/if_aq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aq.c,v 1.35 2022/09/22 06:04:26 skrll Exp $ */
+/* $NetBSD: if_aq.c,v 1.36 2022/10/17 10:39:01 riastradh Exp $ */
/**
* aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.35 2022/09/22 06:04:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.36 2022/10/17 10:39:01 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_if_aq.h"
@@ -4898,11 +4898,8 @@ aq_stop_locked(struct ifnet *ifp, bool disable)
RX_DMA_DESC_CACHE_INIT_REG, RX_DMA_DESC_CACHE_INIT) ^ 1);
already_stopped:
- if (!disable) {
- /* when pmf stop, disable link status intr and callout */
- aq_enable_intr(sc, false, false);
- callout_halt(&sc->sc_tick_ch, &sc->sc_mutex);
- }
+ aq_enable_intr(sc, false, false);
+ callout_halt(&sc->sc_tick_ch, &sc->sc_mutex);
ifp->if_flags &= ~IFF_RUNNING;
sc->sc_if_flags = ifp->if_flags;