summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-03 05:49:29 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-03 05:49:29 +0000
commitb74084dc3f086e5fa83e3aef422dd3078392e5aa (patch)
tree6b14aa208763e89191444e416627cc106ff0938e /sys/dev
parent6d8662ba88e1000194b442927bb2313e7f514bf3 (diff)
usbnet: Omit needless locking/busying/testing in usbnet_tick_task.
usbnet_stop waits for the task to complete before resetting the hardware, and usbnet_detach waits for usbnet_stop to complete before destroying anything, so there's no need for any of this.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbnet.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
index b9713288b4d..7c87f2dce5d 100644
--- a/sys/dev/usb/usbnet.c
+++ b/sys/dev/usb/usbnet.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.64 2022/03/03 05:49:22 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.65 2022/03/03 05:49:29 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.64 2022/03/03 05:49:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.65 2022/03/03 05:49:29 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1239,22 +1239,10 @@ usbnet_tick_task(void *arg)
USBNETHIST_FUNC();
struct usbnet * const un = arg;
struct usbnet_private * const unp = un->un_pri;
-
- USBNETHIST_CALLARGSN(8, "%jd: enter", unp->unp_number, 0, 0, 0);
-
- mutex_enter(&unp->unp_core_lock);
- if (unp->unp_stopping || unp->unp_dying) {
- mutex_exit(&unp->unp_core_lock);
- return;
- }
-
struct ifnet * const ifp = usbnet_ifp(un);
struct mii_data * const mii = usbnet_mii(un);
- KASSERT(ifp != NULL); /* embedded member */
-
- usbnet_busy(un);
- mutex_exit(&unp->unp_core_lock);
+ USBNETHIST_CALLARGSN(8, "%jd: enter", unp->unp_number, 0, 0, 0);
mutex_enter(&unp->unp_txlock);
const bool timeout = unp->unp_timer != 0 && --unp->unp_timer == 0;
@@ -1275,7 +1263,6 @@ usbnet_tick_task(void *arg)
uno_tick(un);
mutex_enter(&unp->unp_core_lock);
- usbnet_unbusy(un);
if (!unp->unp_stopping && !unp->unp_dying)
callout_schedule(&unp->unp_stat_ch, hz);
mutex_exit(&unp->unp_core_lock);