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 smsc(4).



details:   https://anonhg.NetBSD.org/src/rev/758823382332
branches:  trunk
changeset: 365045:758823382332
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 29 02:01:32 2018 +0000

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

XXX The stop task doesn't seem to be used in this driver.

diffstat:

 sys/dev/usb/if_smsc.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r 4078962305d9 -r 758823382332 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c     Sun Jul 29 02:01:22 2018 +0000
+++ b/sys/dev/usb/if_smsc.c     Sun Jul 29 02:01:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smsc.c,v 1.34 2018/06/26 06:48:02 msaitoh Exp $     */
+/*     $NetBSD: if_smsc.c,v 1.35 2018/07/29 02:01:32 riastradh Exp $   */
 
 /*     $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -1140,7 +1140,7 @@
        struct ifnet *ifp = &sc->sc_ec.ec_if;
        int s;
 
-       callout_stop(&sc->sc_stat_ch);
+       callout_halt(&sc->sc_stat_ch, NULL);
 
        if (sc->sc_ep[SMSC_ENDPT_TX] != NULL)
                usbd_abort_pipe(sc->sc_ep[SMSC_ENDPT_TX]);
@@ -1149,12 +1149,8 @@
        if (sc->sc_ep[SMSC_ENDPT_INTR] != NULL)
                usbd_abort_pipe(sc->sc_ep[SMSC_ENDPT_INTR]);
 
-       /*
-        * Remove any pending tasks.  They cannot be executing because they run
-        * in the same thread as detach.
-        */
-       usb_rem_task(sc->sc_udev, &sc->sc_tick_task);
-       usb_rem_task(sc->sc_udev, &sc->sc_stop_task);
+       usb_rem_task_wait(sc->sc_udev, &sc->sc_tick_task, USB_TASKQ_DRIVER);
+       usb_rem_task_wait(sc->sc_udev, &sc->sc_stop_task, USB_TASKQ_DRIVER);
 
        s = splusb();
 



Home | Main Index | Thread Index | Old Index