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 mii callbacks.



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

description:
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.

diffstat:

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

diffs (50 lines):

diff -r a1fee83d1263 -r c3e0af5de83a sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Thu Mar 03 05:51:56 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Thu Mar 03 05:52:03 2022 +0000
@@ -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 @@
                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 @@
                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 @@
        /* MII layer ensures core_lock is held. */
        usbnet_isowned_core(un);
 
-       usbnet_busy(un);
        uno_mii_statchg(un, ifp);
-       usbnet_unbusy(un);
 }
 
 static int



Home | Main Index | Thread Index | Old Index