Index: sys/dev/pci/if_aq.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/if_aq.c,v retrieving revision 1.33 diff -u -p -r1.33 if_aq.c --- sys/dev/pci/if_aq.c 16 Sep 2022 03:55:53 -0000 1.33 +++ sys/dev/pci/if_aq.c 22 Sep 2022 05:51:34 -0000 @@ -1278,7 +1278,7 @@ aq_attach(device_t parent, device_t self int error; sc->sc_dev = self; - mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_NET); + mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_SOFTCLOCK); mutex_init(&sc->sc_mpi_mutex, MUTEX_DEFAULT, IPL_NET); sc->sc_pc = pc = pa->pa_pc; @@ -1588,7 +1588,9 @@ aq_detach(device_t self, int flags __unu if (sc->sc_iosize != 0) { if (ifp->if_softc != NULL) { - aq_stop(ifp, 0); + IFNET_LOCK(ifp); + aq_stop(ifp, 1); + IFNET_UNLOCK(ifp); } for (i = 0; i < AQ_NINTR_MAX; i++) { @@ -1616,8 +1618,6 @@ aq_detach(device_t self, int flags __unu sc->sc_iosize = 0; } - callout_stop(&sc->sc_tick_ch); - #if NSYSMON_ENVSYS > 0 if (sc->sc_sme != NULL) { /* all sensors associated with this will also be detached */ @@ -3045,6 +3045,7 @@ aq_hw_interrupt_moderation_set(struct aq { int i; + // intr lock if (sc->sc_intr_moderation_enable) { unsigned int tx_min, rx_min; /* 0-255 */ unsigned int tx_max, rx_max; /* 0-511? */ @@ -3104,7 +3105,6 @@ aq_hw_interrupt_moderation_set(struct aq __SHIFTIN(rx_max, RX_INTR_MODERATION_CTL_MAX) | RX_INTR_MODERATION_CTL_EN); } - } else { AQ_WRITE_REG_BIT(sc, TX_DMA_INT_DESC_WRWB_EN_REG, TX_DMA_INT_DESC_WRWB_EN, 1); @@ -3889,7 +3889,7 @@ aq_watchdog_check(struct aq_softc * cons if (sc->sc_trigger_reset) { /* debug operation, no need for atomicity or reliability */ - sc->sc_trigger_reset = 0; + sc->sc_trigger_reset = false; return false; }