Source-Changes-HG archive

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

[src/nick-nhusb]: src/sys/dev/usb Use IPL_SOFTUSB instead of IPL_USB appropri...



details:   https://anonhg.NetBSD.org/src/rev/bb5c75e827db
branches:  nick-nhusb
changeset: 804495:bb5c75e827db
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Dec 28 10:15:09 2015 +0000

description:
Use IPL_SOFTUSB instead of IPL_USB appropriately.  Transfer completions
are executed as a softint and so this is the priority level required.

diffstat:

 sys/dev/usb/uatp.c   |   6 +++---
 sys/dev/usb/ubt.c    |   6 +++---
 sys/dev/usb/ugen.c   |   6 +++---
 sys/dev/usb/uhid.c   |   6 +++---
 sys/dev/usb/uhidev.c |   6 +++---
 sys/dev/usb/umass.c  |   6 +++---
 sys/dev/usb/umidi.c  |  18 +++++++++---------
 7 files changed, 27 insertions(+), 27 deletions(-)

diffs (230 lines):

diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/uatp.c
--- a/sys/dev/usb/uatp.c        Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/uatp.c        Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uatp.c,v 1.10.4.6 2015/09/29 11:38:29 skrll Exp $      */
+/*     $NetBSD: uatp.c,v 1.10.4.7 2015/12/28 10:15:09 skrll Exp $      */
 
 /*-
  * Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.10.4.6 2015/09/29 11:38:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.10.4.7 2015/12/28 10:15:09 skrll Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2014,7 +2014,7 @@
 {
        callout_init(&sc->sc_untap_callout, 0);
        callout_setfunc(&sc->sc_untap_callout, untap_callout, sc);
-       mutex_init(&sc->sc_tap_mutex, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_tap_mutex, MUTEX_DEFAULT, IPL_SOFTUSB);
        cv_init(&sc->sc_tap_cv, "uatptap");
 }
 
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/ubt.c
--- a/sys/dev/usb/ubt.c Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/ubt.c Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ubt.c,v 1.51.4.7 2015/12/28 09:26:33 skrll Exp $       */
+/*     $NetBSD: ubt.c,v 1.51.4.8 2015/12/28 10:15:09 skrll Exp $       */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.51.4.7 2015/12/28 09:26:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.51.4.8 2015/12/28 10:15:09 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -276,7 +276,7 @@
        .output_acl = ubt_xmit_acl,
        .output_sco = ubt_xmit_sco,
        .get_stats = ubt_stats,
-       .ipl = IPL_USB,         /* IPL_SOFTUSB ??? */
+       .ipl = IPL_SOFTUSB,
 };
 
 /*******************************************************************************
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/ugen.c
--- a/sys/dev/usb/ugen.c        Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/ugen.c        Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ugen.c,v 1.126.2.12 2015/12/28 09:26:33 skrll Exp $    */
+/*     $NetBSD: ugen.c,v 1.126.2.13 2015/12/28 10:15:09 skrll Exp $    */
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.126.2.12 2015/12/28 09:26:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.126.2.13 2015/12/28 10:15:09 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -222,7 +222,7 @@
        aprint_naive("\n");
        aprint_normal("\n");
 
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
        cv_init(&sc->sc_detach_cv, "ugendet");
 
        devinfop = usbd_devinfo_alloc(uaa->uaa_device, 0);
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c        Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/uhid.c        Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhid.c,v 1.92.4.7 2015/09/29 11:38:29 skrll Exp $      */
+/*     $NetBSD: uhid.c,v 1.92.4.8 2015/12/28 10:15:09 skrll Exp $      */
 
 /*
  * Copyright (c) 1998, 2004, 2008, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.92.4.7 2015/09/29 11:38:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.92.4.8 2015/12/28 10:15:09 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -186,7 +186,7 @@
               sc->sc_isize, sc->sc_osize, sc->sc_fsize);
 
        mutex_init(&sc->sc_access_lock, MUTEX_DEFAULT, IPL_NONE);
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
        cv_init(&sc->sc_cv, "uhidrea");
        cv_init(&sc->sc_detach_cv, "uhiddet");
 
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/uhidev.c
--- a/sys/dev/usb/uhidev.c      Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/uhidev.c      Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhidev.c,v 1.61.4.10 2015/10/06 21:32:15 skrll Exp $   */
+/*     $NetBSD: uhidev.c,v 1.61.4.11 2015/12/28 10:15:09 skrll Exp $   */
 
 /*
  * Copyright (c) 2001, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.61.4.10 2015/10/06 21:32:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.61.4.11 2015/12/28 10:15:09 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -136,7 +136,7 @@
        aprint_naive("\n");
        aprint_normal("\n");
 
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
 
        id = usbd_get_interface_descriptor(iface);
 
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/umass.c       Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.149.2.10 2015/12/28 09:26:33 skrll Exp $   */
+/*     $NetBSD: umass.c,v 1.149.2.11 2015/12/28 10:15:09 skrll Exp $   */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.149.2.10 2015/12/28 09:26:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.149.2.11 2015/12/28 10:15:09 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -337,7 +337,7 @@
        aprint_naive("\n");
        aprint_normal("\n");
 
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
        cv_init(&sc->sc_detach_cv, "umassdet");
 
        devinfop = usbd_devinfo_alloc(uiaa->uiaa_device, 0);
diff -r aba2b2503fa2 -r bb5c75e827db sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c       Mon Dec 28 10:13:45 2015 +0000
+++ b/sys/dev/usb/umidi.c       Mon Dec 28 10:15:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umidi.c,v 1.65.14.9 2015/12/28 09:26:33 skrll Exp $    */
+/*     $NetBSD: umidi.c,v 1.65.14.10 2015/12/28 10:15:09 skrll Exp $   */
 
 /*
  * Copyright (c) 2001, 2012, 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.65.14.9 2015/12/28 09:26:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.65.14.10 2015/12/28 10:15:09 skrll Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -360,7 +360,7 @@
        aprint_normal_dev(self, "");
        umidi_print_quirk(sc->sc_quirk);
 
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_USB);
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
        cv_init(&sc->sc_cv, "umidopcl");
        cv_init(&sc->sc_detach_cv, "umidetcv");
        sc->sc_refcnt = 0;
@@ -1214,11 +1214,11 @@
 {
        int i;
 
-       mutex_spin_enter(&sc->sc_lock);
+       mutex_enter(&sc->sc_lock);
        if (sc->sc_mididevs)
                for (i = 0; i < sc->sc_num_mididevs; i++)
                        unbind_jacks_from_mididev(&sc->sc_mididevs[i]);
-       mutex_spin_exit(&sc->sc_lock);
+       mutex_exit(&sc->sc_lock);
 }
 
 static usbd_status
@@ -1387,9 +1387,9 @@
                         * the abort operation.  This is safe as this
                         * either closing or dying will be set proerly.
                         */
-                       mutex_spin_exit(&sc->sc_lock);
+                       mutex_exit(&sc->sc_lock);
                        usbd_abort_pipe(jack->endpoint->pipe);
-                       mutex_spin_enter(&sc->sc_lock);
+                       mutex_enter(&sc->sc_lock);
                }
        }
 }
@@ -1417,12 +1417,12 @@
        if (!sc)
                return USBD_NO_ADDR;
 
-       mutex_spin_enter(&sc->sc_lock);
+       mutex_enter(&sc->sc_lock);
        if (mididev->opened) {
                umidi_close(mididev);
        }
        unbind_jacks_from_mididev(mididev);
-       mutex_spin_exit(&sc->sc_lock);
+       mutex_exit(&sc->sc_lock);
 
        if (mididev->mdev != NULL)
                config_detach(mididev->mdev, flags);



Home | Main Index | Thread Index | Old Index