Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb usbnet: No need for usbnet_busy in usbnet_init_r...



details:   https://anonhg.NetBSD.org/src/rev/a1fee83d1263
branches:  trunk
changeset: 362521:a1fee83d1263
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Mar 03 05:51:56 2022 +0000

description:
usbnet: No need for usbnet_busy in usbnet_init_rx_tx or usbnet_stop.

These run with IFNET_LOCK held, and the interface cannot be detached
until the IFNET_LOCK is released, so there is no need to hang onto a
reference count here.

diffstat:

 sys/dev/usb/usbnet.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r f86af1b2bc58 -r a1fee83d1263 sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Thu Mar 03 05:51:44 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Thu Mar 03 05:51:56 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbnet.c,v 1.75 2022/03/03 05:51:06 riastradh Exp $    */
+/*     $NetBSD: usbnet.c,v 1.76 2022/03/03 05:51:56 riastradh Exp $    */
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.75 2022/03/03 05:51:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.76 2022/03/03 05:51:56 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -837,8 +837,6 @@
                return EIO;
        }
 
-       usbnet_busy(un);
-
        /* Open RX and TX pipes. */
        err = usbnet_ep_open_pipes(un);
        if (err) {
@@ -879,7 +877,6 @@
                usbnet_tx_list_fini(un);
                usbnet_ep_close_pipes(un);
        }
-       usbnet_unbusy(un);
 
        usbnet_isowned_core(un);
 
@@ -1126,8 +1123,6 @@
            "%s", ifp->if_xname);
        usbnet_isowned_core(un);
 
-       usbnet_busy(un);
-
        /*
         * Prevent new activity (rescheduling ticks, xfers, &c.) and
         * clear the watchdog timer.
@@ -1176,8 +1171,6 @@
        KASSERTMSG(!unp->unp_ifp_attached || IFNET_LOCKED(ifp),
            "%s", ifp->if_xname);
        ifp->if_flags &= ~IFF_RUNNING;
-
-       usbnet_unbusy(un);
 }
 
 static void



Home | Main Index | Thread Index | Old Index