Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Take and release IFNET_LOCK around aq_stop in aq...



details:   https://anonhg.NetBSD.org/src/rev/245d9153bc46
branches:  trunk
changeset: 370633:245d9153bc46
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Sep 22 06:04:26 2022 +0000

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

diffstat:

 sys/dev/pci/if_aq.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 23ea1fb7a722 -r 245d9153bc46 sys/dev/pci/if_aq.c
--- a/sys/dev/pci/if_aq.c       Thu Sep 22 05:50:52 2022 +0000
+++ b/sys/dev/pci/if_aq.c       Thu Sep 22 06:04:26 2022 +0000
@@ -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 @@
 
        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 @@
                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 */



Home | Main Index | Thread Index | Old Index