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/fcb9294c7ba7
branches:  trunk
changeset: 377020:fcb9294c7ba7
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 c8b6f70f236b -r fcb9294c7ba7 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 @@ usbwifi_txeof(struct usbd_xfer *xfer, vo
                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 @@ usbwifi_watchdog(struct usbwifi *uw)
                        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