Module Name: src Committed By: riastradh Date: Thu Mar 3 05:51:56 UTC 2022
Modified Files: src/sys/dev/usb: usbnet.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/sys/dev/usb/usbnet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/usbnet.c diff -u src/sys/dev/usb/usbnet.c:1.75 src/sys/dev/usb/usbnet.c:1.76 --- src/sys/dev/usb/usbnet.c:1.75 Thu Mar 3 05:51:06 2022 +++ src/sys/dev/usb/usbnet.c Thu Mar 3 05:51:56 2022 @@ -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 @@ usbnet_init_rx_tx(struct usbnet * const return EIO; } - usbnet_busy(un); - /* Open RX and TX pipes. */ err = usbnet_ep_open_pipes(un); if (err) { @@ -879,7 +877,6 @@ out: usbnet_tx_list_fini(un); usbnet_ep_close_pipes(un); } - usbnet_unbusy(un); usbnet_isowned_core(un); @@ -1126,8 +1123,6 @@ usbnet_stop(struct usbnet *un, struct if "%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 @@ usbnet_stop(struct usbnet *un, struct if KASSERTMSG(!unp->unp_ifp_attached || IFNET_LOCKED(ifp), "%s", ifp->if_xname); ifp->if_flags &= ~IFF_RUNNING; - - usbnet_unbusy(un); } static void