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 Make sure to hold the TX lock when calling...



details:   https://anonhg.NetBSD.org/src-all/rev/dd6837df3915
branches:  trunk
changeset: 370505:dd6837df3915
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sun Oct 17 12:17:33 2021 +0200

description:
Make sure to hold the TX lock when calling one of the start functions.

diffstat:

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

diffs (30 lines):

diff -r 2f313bac2643 -r dd6837df3915 sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c     Sun Oct 17 11:54:31 2021 +0200
+++ b/sys/dev/usb/usbwifi.c     Sun Oct 17 12:17:33 2021 +0200
@@ -383,11 +383,11 @@
                break;
        }
 
-       mutex_exit(&uwp->uwp_txlock);
-
        if (status == USBD_NORMAL_COMPLETION &&
            !IFQ_IS_EMPTY(&uwp->uwp_sendq[c->uwc_index]))
                usbwifi_tx_prio_start(uw, c->uwc_index);
+
+       mutex_exit(&uwp->uwp_txlock);
 }
 
 static void
@@ -1079,8 +1079,11 @@
                        break;
                }
        }
-       if (found)
+       if (found) {
+               mutex_enter(&uw->uw_pri->uwp_txlock);
                usbwifi_start(uw);
+               mutex_exit(&uw->uw_pri->uwp_txlock);
+       }
 }
 
 static void



Home | Main Index | Thread Index | Old Index