Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Don't hold any locks in tx/rx functions as...



details:   https://anonhg.NetBSD.org/src-all/rev/d6e17eddeac1
branches:  trunk
changeset: 990225:d6e17eddeac1
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Fri Aug 14 02:25:10 2020 +1000

description:
Don't hold any locks in tx/rx functions as they lock up the device and are
unnecessary as they were only a protection mechanism when allocating/freeing
usb transfer memory.

This was already guarded against by usb_pipe close functions.

diffstat:

 sys/dev/usb/if_urtwn.c |  6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r 291963dd14f6 -r d6e17eddeac1 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Fri Jul 03 12:05:49 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Fri Aug 14 02:25:10 2020 +1000
@@ -3021,15 +3021,11 @@
        DPRINTFN(DBG_FN|DBG_RX, ("%s: %s: status=%d\n",
            device_xname(sc->sc_dev), __func__, status));
 
-       mutex_enter(&sc->sc_write_mtx);
-       mutex_enter(&sc->sc_rx_mtx);
        if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
                if (status == USBD_STALLED)
                        usbd_clear_endpoint_stall_async(sc->rx_pipe[pidx]);
                else if (status != USBD_CANCELLED)
                        goto resubmit;
-               mutex_exit(&sc->sc_rx_mtx);
-               mutex_exit(&sc->sc_write_mtx);
                return;
        }
        usbd_get_xfer_status(xfer, NULL, NULL, &len, NULL);
@@ -3093,8 +3089,6 @@
        usbd_setup_xfer(xfer, data, data->buf, URTWN_RXBUFSZ,
            USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT, urtwn_rxeof);
        (void)usbd_transfer(xfer);
-       mutex_exit(&sc->sc_rx_mtx);
-       mutex_exit(&sc->sc_write_mtx);
 }
 
 static void



Home | Main Index | Thread Index | Old Index