Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb - Add a USBD_MPSAFE flag to usbd_open_pipe. If n...



details:   https://anonhg.NetBSD.org/src/rev/43cde0ab239d
branches:  trunk
changeset: 784215:43cde0ab239d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jan 22 12:40:42 2013 +0000

description:
- Add a USBD_MPSAFE flag to usbd_open_pipe. If not set, acquire KERNEL_LOCK
  before invoking xfer callbacks on this pipe.
- Add an extra flags parameter to usb_init_task. If USBD_TASKQ_MPSAFE is not
  present, acquire KERNEL_LOCK before invoking the task callback.

diffstat:

 sys/dev/usb/auvitek_dtv.c |   6 +++---
 sys/dev/usb/ehci.c        |   7 ++++---
 sys/dev/usb/emdtv_dtv.c   |   6 +++---
 sys/dev/usb/if_atu.c      |   6 +++---
 sys/dev/usb/if_aue.c      |   8 ++++----
 sys/dev/usb/if_axe.c      |   6 +++---
 sys/dev/usb/if_cue.c      |   6 +++---
 sys/dev/usb/if_otus.c     |   6 +++---
 sys/dev/usb/if_rum.c      |   6 +++---
 sys/dev/usb/if_run.c      |   6 +++---
 sys/dev/usb/if_smsc.c     |   6 +++---
 sys/dev/usb/if_udav.c     |   8 ++++----
 sys/dev/usb/if_upgt.c     |   8 ++++----
 sys/dev/usb/if_ural.c     |   6 +++---
 sys/dev/usb/if_url.c      |   8 ++++----
 sys/dev/usb/if_urtw.c     |   8 ++++----
 sys/dev/usb/if_urtwn.c    |  12 +++---------
 sys/dev/usb/if_zyd.c      |   6 +++---
 sys/dev/usb/ohci.c        |   7 ++++---
 sys/dev/usb/uaudio.c      |   9 +++++----
 sys/dev/usb/uhci.c        |   7 ++++---
 sys/dev/usb/usb.c         |  10 ++++++++--
 sys/dev/usb/usb_subr.c    |  15 ++++++++++++---
 sys/dev/usb/usbdi.c       |  16 ++++++++++++++--
 sys/dev/usb/usbdi.h       |   7 +++++--
 sys/dev/usb/usbdivar.h    |   8 +++++++-
 26 files changed, 119 insertions(+), 85 deletions(-)

diffs (truncated from 808 to 300 lines):

diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/auvitek_dtv.c
--- a/sys/dev/usb/auvitek_dtv.c Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/auvitek_dtv.c Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_dtv.c,v 1.5 2012/01/09 10:57:34 jmcneill Exp $ */
+/* $NetBSD: auvitek_dtv.c,v 1.6 2013/01/22 12:40:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.5 2012/01/09 10:57:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.6 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -259,7 +259,7 @@
 
        KERNEL_LOCK(1, curlwp);
        err = usbd_open_pipe(sc->sc_bulk_iface, sc->sc_ab.ab_endpt,
-           USBD_EXCLUSIVE_USE, &sc->sc_ab.ab_pipe);
+           USBD_EXCLUSIVE_USE|USBD_MPSAFE, &sc->sc_ab.ab_pipe);
        KERNEL_UNLOCK_ONE(curlwp);
 
        if (err) {
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/ehci.c        Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.202 2013/01/15 17:45:05 christos Exp $ */
+/*     $NetBSD: ehci.c,v 1.203 2013/01/22 12:40:42 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.202 2013/01/15 17:45:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.203 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3228,7 +3228,8 @@
        }
 
        /* Execute the abort in a process context. */
-       usb_init_task(&exfer->abort_task, ehci_timeout_task, addr);
+       usb_init_task(&exfer->abort_task, ehci_timeout_task, addr,
+           USB_TASKQ_MPSAFE);
        usb_add_task(exfer->xfer.pipe->device, &exfer->abort_task,
            USB_TASKQ_HC);
 }
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/emdtv_dtv.c
--- a/sys/dev/usb/emdtv_dtv.c   Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/emdtv_dtv.c   Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv_dtv.c,v 1.9 2012/03/11 01:06:06 mrg Exp $ */
+/* $NetBSD: emdtv_dtv.c,v 1.10 2013/01/22 12:40:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2008, 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.9 2012/03/11 01:06:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.10 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,7 +103,7 @@
        aprint_debug_dev(sc->sc_dev, "calling usbd_open_pipe, ep 0x%02x\n",
            ed->bEndpointAddress);
        status = usbd_open_pipe(sc->sc_iface, 
-           ed->bEndpointAddress, USBD_EXCLUSIVE_USE,
+           ed->bEndpointAddress, USBD_EXCLUSIVE_USE|USBD_MPSAFE,
            &sc->sc_isoc_pipe);
        if (status != USBD_NORMAL_COMPLETION) {
                aprint_error_dev(sc->sc_dev, "couldn't open isoc pipe\n");
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_atu.c
--- a/sys/dev/usb/if_atu.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_atu.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_atu.c,v 1.47 2013/01/05 23:34:16 christos Exp $ */
+/*     $NetBSD: if_atu.c,v 1.48 2013/01/22 12:40:42 jmcneill Exp $ */
 /*     $OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */
 /*
  * Copyright (c) 2003, 2004
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.47 2013/01/05 23:34:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.48 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -1461,7 +1461,7 @@
        /* setup ifmedia interface */
        ieee80211_media_init(ic, atu_media_change, atu_media_status);
 
-       usb_init_task(&sc->sc_task, atu_task, sc);
+       usb_init_task(&sc->sc_task, atu_task, sc, 0);
 
        sc->sc_state = ATU_S_OK;
 }
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_aue.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.129 2013/01/05 01:30:15 christos Exp $    */
+/*     $NetBSD: if_aue.c,v 1.130 2013/01/22 12:40:42 jmcneill Exp $    */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.129 2013/01/05 01:30:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.130 2013/01/22 12:40:42 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -752,8 +752,8 @@
                return;
        }
 
-       usb_init_task(&sc->aue_tick_task, aue_tick_task, sc);
-       usb_init_task(&sc->aue_stop_task, (void (*)(void *))aue_stop, sc);
+       usb_init_task(&sc->aue_tick_task, aue_tick_task, sc, 0);
+       usb_init_task(&sc->aue_stop_task, (void (*)(void *))aue_stop, sc, 0);
        mutex_init(&sc->aue_mii_lock, MUTEX_DEFAULT, IPL_NONE);
 
        err = usbd_device2interface_handle(dev, AUE_IFACE_IDX, &iface);
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_axe.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.63 2013/01/16 17:18:55 christos Exp $     */
+/*     $NetBSD: if_axe.c,v 1.64 2013/01/22 12:40:42 jmcneill Exp $     */
 /*     $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
 
 /*
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.63 2013/01/16 17:18:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.64 2013/01/22 12:40:42 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -611,7 +611,7 @@
        sc->axe_flags = axe_lookup(uaa->vendor, uaa->product)->axe_flags;
 
        mutex_init(&sc->axe_mii_lock, MUTEX_DEFAULT, IPL_NONE);
-       usb_init_task(&sc->axe_tick_task, axe_tick_task, sc);
+       usb_init_task(&sc->axe_tick_task, axe_tick_task, sc, 0);
 
        err = usbd_device2interface_handle(dev, AXE_IFACE_IDX, &sc->axe_iface);
        if (err) {
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_cue.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cue.c,v 1.65 2013/01/05 01:30:15 christos Exp $     */
+/*     $NetBSD: if_cue.c,v 1.66 2013/01/22 12:40:42 jmcneill Exp $     */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.65 2013/01/05 01:30:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.66 2013/01/22 12:40:42 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -488,7 +488,7 @@
        sc->cue_product = uaa->product;
        sc->cue_vendor = uaa->vendor;
 
-       usb_init_task(&sc->cue_tick_task, cue_tick_task, sc);
+       usb_init_task(&sc->cue_tick_task, cue_tick_task, sc, 0);
        usb_init_task(&sc->cue_stop_task, (void (*)(void *))cue_stop, sc);
 
        err = usbd_device2interface_handle(dev, CUE_IFACE_IDX, &iface);
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_otus.c
--- a/sys/dev/usb/if_otus.c     Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_otus.c     Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_otus.c,v 1.21 2013/01/21 16:52:56 christos Exp $    */
+/*     $NetBSD: if_otus.c,v 1.22 2013/01/22 12:40:42 jmcneill Exp $    */
 /*     $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $        */
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.21 2013/01/21 16:52:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.22 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -637,7 +637,7 @@
        mutex_init(&sc->sc_tx_mtx,    MUTEX_DEFAULT, IPL_NONE);
        mutex_init(&sc->sc_write_mtx, MUTEX_DEFAULT, IPL_NONE);
 
-       usb_init_task(&sc->sc_task, otus_task, sc);
+       usb_init_task(&sc->sc_task, otus_task, sc, 0);
 
        callout_init(&sc->sc_scan_to, 0);
        callout_setfunc(&sc->sc_scan_to, otus_next_scan, sc);
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_rum.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $      */
-/*     $NetBSD: if_rum.c,v 1.46 2013/01/05 23:34:17 christos Exp $     */
+/*     $NetBSD: if_rum.c,v 1.47 2013/01/22 12:40:42 jmcneill Exp $     */
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.46 2013/01/05 23:34:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.47 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -366,7 +366,7 @@
                return;
        }
 
-       usb_init_task(&sc->sc_task, rum_task, sc);
+       usb_init_task(&sc->sc_task, rum_task, sc, 0);
        callout_init(&sc->sc_scan_ch, 0);
 
        sc->amrr.amrr_min_success_threshold =  1;
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_run.c
--- a/sys/dev/usb/if_run.c      Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_run.c      Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_run.c,v 1.7 2013/01/05 23:34:17 christos Exp $      */
+/*     $NetBSD: if_run.c,v 1.8 2013/01/22 12:40:42 jmcneill Exp $      */
 /*     $OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $ */
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.7 2013/01/05 23:34:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.8 2013/01/22 12:40:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -538,7 +538,7 @@
                return;
        }
 
-       usb_init_task(&sc->sc_task, run_task, sc);
+       usb_init_task(&sc->sc_task, run_task, sc, 0);
        callout_init(&sc->scan_to, 0);
        callout_setfunc(&sc->scan_to, run_next_scan, sc);
        callout_init(&sc->calib_to, 0);
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c     Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_smsc.c     Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smsc.c,v 1.5 2013/01/13 15:34:03 skrll Exp $        */
+/*     $NetBSD: if_smsc.c,v 1.6 2013/01/22 12:40:43 jmcneill 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 $ */
@@ -996,8 +996,8 @@
                return;
        }
        /* Setup the endpoints for the SMSC LAN95xx device(s) */
-       usb_init_task(&sc->sc_tick_task, smsc_tick_task, sc);
-       usb_init_task(&sc->sc_stop_task, (void (*)(void *))smsc_stop, sc);
+       usb_init_task(&sc->sc_tick_task, smsc_tick_task, sc, 0);
+       usb_init_task(&sc->sc_stop_task, (void (*)(void *))smsc_stop, sc, 0);
        mutex_init(&sc->sc_mii_lock, MUTEX_DEFAULT, IPL_NONE);
 
        err = usbd_device2interface_handle(dev, SMSC_IFACE_IDX, &sc->sc_iface);
diff -r 6899d29ec287 -r 43cde0ab239d sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c     Tue Jan 22 12:04:58 2013 +0000
+++ b/sys/dev/usb/if_udav.c     Tue Jan 22 12:40:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_udav.c,v 1.40 2013/01/05 01:30:16 christos Exp $    */
+/*     $NetBSD: if_udav.c,v 1.41 2013/01/22 12:40:43 jmcneill Exp $    */



Home | Main Index | Thread Index | Old Index