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/bb0fdb7c7fdd
branches:  trunk
changeset: 948534:bb0fdb7c7fdd
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 a9735742b501 -r bb0fdb7c7fdd 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
@@ -3016,15 +3016,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);
@@ -3088,8 +3084,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