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 the core lock in usbnet_iffl...
details: https://anonhg.NetBSD.org/src/rev/7f11a4d5d7b5
branches: trunk
changeset: 362525:7f11a4d5d7b5
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Mar 03 05:52:27 2022 +0000
description:
usbnet: No need for the core lock in usbnet_ifflags_cb.
The only state this touches is unp_if_flags, and all paths touching
it also hold IFNET_LOCK -- not to mention this is the only path that
touches unp_if_flags in the first place!
diffstat:
sys/dev/usb/usbnet.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diffs (36 lines):
diff -r d9d04265779e -r 7f11a4d5d7b5 sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c Thu Mar 03 05:52:20 2022 +0000
+++ b/sys/dev/usb/usbnet.c Thu Mar 03 05:52:27 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.79 2022/03/03 05:52:20 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.80 2022/03/03 05:52:27 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.79 2022/03/03 05:52:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.80 2022/03/03 05:52:27 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -987,8 +987,6 @@
KASSERTMSG(IFNET_LOCKED(ifp), "%s", ifp->if_xname);
- mutex_enter(&unp->unp_core_lock);
-
const u_short changed = ifp->if_flags ^ unp->unp_if_flags;
if ((changed & ~(IFF_CANTCHANGE | IFF_DEBUG)) == 0) {
unp->unp_if_flags = ifp->if_flags;
@@ -998,8 +996,6 @@
rv = ENETRESET;
}
- mutex_exit(&unp->unp_core_lock);
-
return rv;
}
Home |
Main Index |
Thread Index |
Old Index