Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Use callout_halt and usb_rem_task_wait in axen(4).



details:   https://anonhg.NetBSD.org/src/rev/73b04bda1545
branches:  trunk
changeset: 365040:73b04bda1545
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 29 02:00:38 2018 +0000

description:
Use callout_halt and usb_rem_task_wait in axen(4).

diffstat:

 sys/dev/usb/if_axen.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (33 lines):

diff -r b0bd0a5f0164 -r 73b04bda1545 sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Sun Jul 29 02:00:27 2018 +0000
+++ b/sys/dev/usb/if_axen.c     Sun Jul 29 02:00:38 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.14 2018/07/20 16:38:42 martin Exp $      */
+/*     $NetBSD: if_axen.c,v 1.15 2018/07/29 02:00:38 riastradh Exp $   */
 /*     $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.14 2018/07/20 16:38:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.15 2018/07/29 02:00:38 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -827,11 +827,9 @@
 
        sc->axen_dying = true;
 
-       /*
-        * Remove any pending tasks.  They cannot be executing because they run
-        * in the same thread as detach.
-        */
-       usb_rem_task(sc->axen_udev, &sc->axen_tick_task);
+       callout_halt(&sc->axen_stat_ch, NULL);
+       usb_rem_task_wait(sc->axen_udev, &sc->axen_tick_task,
+           USB_TASKQ_DRIVER);
 
        s = splusb();
 



Home | Main Index | Thread Index | Old Index