Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Clarify locking order



details:   https://anonhg.NetBSD.org/src-all/rev/e470d146818b
branches:  trunk
changeset: 371082:e470d146818b
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Tue Dec 07 18:22:37 2021 +0100

description:
Clarify locking order

diffstat:

 sys/dev/usb/usbwifi.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r 52bd8091a3dd -r e470d146818b sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c     Sat Nov 20 02:05:19 2021 +1100
+++ b/sys/dev/usb/usbwifi.c     Tue Dec 07 18:22:37 2021 +0100
@@ -65,9 +65,10 @@
         * - uwp_detachcv handles detach vs open references
         *
         * the lock ordering is:
-        *      ifnet lock -> uwp_core_lock -> uwp_rxlock -> uwp_txlock
-        * - ifnet lock is not needed for uwp_core_lock, but if ifnet lock is
-        *   involved, it must be taken first
+        *      IFNET_LOCK(ifp) -> IEEE80211_LOCK(&uw->uw_ic) ->
+        *          uwp_core_lock -> uwp_rxlock -> uwp_txlock
+        * - ifnet lock and ic lock are not needed for uwp_core_lock,
+        *   but if either is involved, they must be taken first.
         */
        kmutex_t                uwp_core_lock;
        kmutex_t                uwp_rxlock;



Home | Main Index | Thread Index | Old Index