Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb revert rev 1.111 (which was 1.106 again, without...



details:   https://anonhg.NetBSD.org/src/rev/3abd58a3ddfb
branches:  trunk
changeset: 370165:3abd58a3ddfb
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Sep 20 07:15:46 2022 +0000

description:
revert rev 1.111 (which was 1.106 again, without the 1.107 changes).

fixes an assert reported by msaitoh@.  also fix another missing miilock
assert in usbnet_stop() that triggered for me.

diffstat:

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

diffs (45 lines):

diff -r b3f38c52f58e -r 3abd58a3ddfb sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Tue Sep 20 06:53:36 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Tue Sep 20 07:15:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbnet.c,v 1.111 2022/09/13 09:38:19 riastradh Exp $   */
+/*     $NetBSD: usbnet.c,v 1.112 2022/09/20 07:15:46 mrg Exp $ */
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.111 2022/09/13 09:38:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.112 2022/09/20 07:15:46 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1162,13 +1162,6 @@
                mutex_exit(&unp->unp_miilock);
        }
 
-       /*
-        * Now that we have stopped calling mii_tick, bring the MII
-        * state machine down.
-        */
-       if (mii)
-               mii_down(mii);
-
        /* Stop transfers. */
        usbnet_ep_stop_pipes(un);
 
@@ -1182,8 +1175,11 @@
         * it's been unplugged then there's no point in trying to touch
         * the registers.
         */
-       if (!usbnet_isdying(un))
+       if (!usbnet_isdying(un)) {
+               mutex_enter(&unp->unp_miilock);
                uno_stop(un, ifp, disable);
+               mutex_exit(&unp->unp_miilock);
+       }
 
        /* Free RX/TX resources. */
        usbnet_rx_list_fini(un);



Home | Main Index | Thread Index | Old Index