Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci aq(4): Unconditionally halt callout in aq_stop.



details:   https://anonhg.NetBSD.org/src/rev/e2ce83270d32
branches:  trunk
changeset: 371920:e2ce83270d32
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Oct 17 10:39:01 2022 +0000

description:
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:

 sys/dev/pci/if_aq.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (32 lines):

diff -r 2e5714b4704f -r e2ce83270d32 sys/dev/pci/if_aq.c
--- a/sys/dev/pci/if_aq.c       Mon Oct 17 07:47:12 2022 +0000
+++ b/sys/dev/pci/if_aq.c       Mon Oct 17 10:39:01 2022 +0000
@@ -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 @@
            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;



Home | Main Index | Thread Index | Old Index