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/807bf3162151
branches:  trunk
changeset: 375527:807bf3162151
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 ed3bbcc33d2e -r 807bf3162151 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
@@ -3022,15 +3022,11 @@ urtwn_rxeof(struct usbd_xfer *xfer, void
        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);
@@ -3094,8 +3090,6 @@ urtwn_rxeof(struct usbd_xfer *xfer, void
        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