Source-Changes-HG archive

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

[src/trunk]: src/sys/net Ensure the timer isn't running by using workqueue_wait



details:   https://anonhg.NetBSD.org/src/rev/c0cf699c2267
branches:  trunk
changeset: 828707:c0cf699c2267
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Dec 28 07:06:36 2017 +0000

description:
Ensure the timer isn't running by using workqueue_wait

diffstat:

 sys/net/if_bridge.c   |  7 ++++---
 sys/net/if_spppsubr.c |  5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (54 lines):

diff -r f8351242576c -r c0cf699c2267 sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Thu Dec 28 07:00:52 2017 +0000
+++ b/sys/net/if_bridge.c       Thu Dec 28 07:06:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.146 2017/12/19 03:32:35 ozaki-r Exp $  */
+/*     $NetBSD: if_bridge.c,v 1.147 2017/12/28 07:06:36 ozaki-r Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.146 2017/12/19 03:32:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.147 2017/12/28 07:06:36 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -1358,7 +1358,8 @@
        KASSERT((ifp->if_flags & IFF_RUNNING) != 0);
        ifp->if_flags &= ~IFF_RUNNING;
 
-       callout_stop(&sc->sc_brcallout);
+       callout_halt(&sc->sc_brcallout, NULL);
+       workqueue_wait(sc->sc_rtage_wq, &sc->sc_rtage_wk);
        bstp_stop(sc);
        bridge_rtflush(sc, IFBF_FLUSHDYN);
 }
diff -r f8351242576c -r c0cf699c2267 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu Dec 28 07:00:52 2017 +0000
+++ b/sys/net/if_spppsubr.c     Thu Dec 28 07:06:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.177 2017/12/11 03:29:20 ozaki-r Exp $         */
+/*     $NetBSD: if_spppsubr.c,v 1.178 2017/12/28 07:06:36 ozaki-r Exp $         */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.177 2017/12/11 03:29:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.178 2017/12/28 07:06:36 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1073,6 +1073,7 @@
 
        /* to avoid workqueue enqueued */
        atomic_swap_uint(&sp->ipcp.update_addrs_enqueued, 1);
+       workqueue_wait(sp->ipcp.update_addrs_wq, &sp->ipcp.update_addrs_wk);
        workqueue_destroy(sp->ipcp.update_addrs_wq);
        pcq_destroy(sp->ipcp.update_addrs_q);
 



Home | Main Index | Thread Index | Old Index