Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb don't use a spin lock, the USB host driver may n...



details:   https://anonhg.NetBSD.org/src/rev/30915b879590
branches:  trunk
changeset: 456847:30915b879590
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed May 29 09:04:01 2019 +0000

description:
don't use a spin lock, the USB host driver may need to take other locks.
stop watchdog timer early to prevent calling txeof twice.
allow more output after USB error by clearing OACTIVE in error path.

diffstat:

 sys/dev/usb/if_mue.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 119478dc7c83 -r 30915b879590 sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c      Wed May 29 08:23:54 2019 +0000
+++ b/sys/dev/usb/if_mue.c      Wed May 29 09:04:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $      */
+/*     $NetBSD: if_mue.c,v 1.50 2019/05/29 09:04:01 mlelstv Exp $      */
 /*     $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $  */
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.50 2019/05/29 09:04:01 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -924,7 +924,7 @@
        usbd_devinfo_free(devinfop);
 
        mutex_init(&sc->mue_mii_lock, MUTEX_DEFAULT, IPL_NONE);
-       mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_NET);
+       mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
 
 #define MUE_CONFIG_NO  1
        err = usbd_set_config_no(dev, MUE_CONFIG_NO, 1);
@@ -1632,6 +1632,7 @@
        s = splnet();
        KASSERT(cd->mue_tx_cnt > 0);
        cd->mue_tx_cnt--;
+       ifp->if_timer = 0;
        if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
                if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
                        splx(s);
@@ -1644,10 +1645,10 @@
                        usbd_clear_endpoint_stall_async(
                            sc->mue_ep[MUE_ENDPT_TX]);
                splx(s);
+               ifp->if_flags &= ~IFF_OACTIVE;
                return;
        }
 
-       ifp->if_timer = 0;
        ifp->if_flags &= ~IFF_OACTIVE;
 
        if (!IFQ_IS_EMPTY(&ifp->if_snd))



Home | Main Index | Thread Index | Old Index