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 usb_rem_task_wait() now that it is available



details:   https://anonhg.NetBSD.org/src/rev/a5b136c5fce4
branches:  trunk
changeset: 993608:a5b136c5fce4
user:      khorben <khorben%NetBSD.org@localhost>
date:      Thu Sep 20 09:45:16 2018 +0000

description:
Use usb_rem_task_wait() now that it is available

This should avoid panics while detaching devices.

diffstat:

 sys/dev/usb/if_umb.c |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (47 lines):

diff -r d82ec5e91860 -r a5b136c5fce4 sys/dev/usb/if_umb.c
--- a/sys/dev/usb/if_umb.c      Thu Sep 20 09:19:56 2018 +0000
+++ b/sys/dev/usb/if_umb.c      Thu Sep 20 09:45:16 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $ */
+/*     $NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $ */
 /*     $OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -91,10 +91,6 @@
 
 #define DEVNAM(sc)             device_xname((sc)->sc_dev)
 
-#ifndef notyet
-#define usb_wait_task(dev, task)
-#endif
-
 /*
  * State change timeout
  */
@@ -584,13 +580,13 @@
                umb_down(sc, 1);
        umb_close(sc);
 
-       usb_rem_task(sc->sc_udev, &sc->sc_get_response_task);
-       usb_wait_task(sc->sc_udev, &sc->sc_get_response_task);
+       usb_rem_task_wait(sc->sc_udev, &sc->sc_get_response_task,
+                       USB_TASKQ_DRIVER, NULL);
        sc->sc_nresp = 0;
        if (sc->sc_rx_ep != -1 && sc->sc_tx_ep != -1) {
                callout_destroy(&sc->sc_statechg_timer);
-               usb_rem_task(sc->sc_udev, &sc->sc_umb_task);
-               usb_wait_task(sc->sc_udev, &sc->sc_umb_task);
+               usb_rem_task_wait(sc->sc_udev, &sc->sc_umb_task,
+                       USB_TASKQ_DRIVER, NULL);
        }
        if (sc->sc_ctrl_pipe) {
                usbd_close_pipe(sc->sc_ctrl_pipe);



Home | Main Index | Thread Index | Old Index