Module Name:    src
Committed By:   riastradh
Date:           Thu Mar  3 05:52:04 UTC 2022

Modified Files:
        src/sys/dev/usb: usbnet.c

Log Message:
usbnet: No need for usbnet_busy in mii callbacks.

After mii_detach, these have all completed and no new ones can be
made, and detach doesn't start destroying anything until after
mii_detach has returned, so there is no need to hang onto a reference
count here.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 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.76 src/sys/dev/usb/usbnet.c:1.77
--- src/sys/dev/usb/usbnet.c:1.76	Thu Mar  3 05:51:56 2022
+++ src/sys/dev/usb/usbnet.c	Thu Mar  3 05:52:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.76 2022/03/03 05:51:56 riastradh Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.77 2022/03/03 05:52:03 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.76 2022/03/03 05:51:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.77 2022/03/03 05:52:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -920,10 +920,7 @@ usbnet_mii_readreg(device_t dev, int phy
 		return EIO;
 	}
 
-	usbnet_busy(un);
 	err = uno_read_reg(un, phy, reg, val);
-	usbnet_unbusy(un);
-
 	if (err) {
 		USBNETHIST_CALLARGS("%jd: read PHY failed: %jd",
 		    un->un_pri->unp_number, err, 0, 0);
@@ -947,10 +944,7 @@ usbnet_mii_writereg(device_t dev, int ph
 		return EIO;
 	}
 
-	usbnet_busy(un);
 	err = uno_write_reg(un, phy, reg, val);
-	usbnet_unbusy(un);
-
 	if (err) {
 		USBNETHIST_CALLARGS("%jd: write PHY failed: %jd",
 		    un->un_pri->unp_number, err, 0, 0);
@@ -969,9 +963,7 @@ usbnet_mii_statchg(struct ifnet *ifp)
 	/* MII layer ensures core_lock is held. */
 	usbnet_isowned_core(un);
 
-	usbnet_busy(un);
 	uno_mii_statchg(un, ifp);
-	usbnet_unbusy(un);
 }
 
 static int

Reply via email to