Module Name:    src
Committed By:   skrll
Date:           Thu Sep 22 06:04:26 UTC 2022

Modified Files:
        src/sys/dev/pci: if_aq.c

Log Message:
Take and release IFNET_LOCK around aq_stop in aq_detach. Also, call with
the disable flag set so that interrupts and the callout are halted.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.34 src/sys/dev/pci/if_aq.c:1.35
--- src/sys/dev/pci/if_aq.c:1.34	Thu Sep 22 05:50:52 2022
+++ src/sys/dev/pci/if_aq.c	Thu Sep 22 06:04:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.34 2022/09/22 05:50:52 riastradh Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.35 2022/09/22 06:04:26 skrll Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.34 2022/09/22 05:50:52 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.35 2022/09/22 06:04:26 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -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 */

Reply via email to