Module Name: src Committed By: riastradh Date: Sun Jul 29 02:01:32 UTC 2018
Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Use callout_halt and usb_rem_task_wait in smsc(4). XXX The stop task doesn't seem to be used in this driver. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/if_smsc.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/usb/if_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.34 src/sys/dev/usb/if_smsc.c:1.35 --- src/sys/dev/usb/if_smsc.c:1.34 Tue Jun 26 06:48:02 2018 +++ src/sys/dev/usb/if_smsc.c Sun Jul 29 02:01:32 2018 @@ -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 @@ smsc_detach(device_t self, int flags) 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 @@ smsc_detach(device_t self, int flags) 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();