git: 45bce6fa306f - main - LinuxKPI: 802.11: lock MO tx/wake_tx_queue() downcalls

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 23 May 2024 23:46:13 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=45bce6fa306fc3a211949f63c9bbb7932fe5a3bd

commit 45bce6fa306fc3a211949f63c9bbb7932fe5a3bd
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-02-18 21:07:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-05-23 23:43:29 +0000

    LinuxKPI: 802.11: lock MO tx/wake_tx_queue() downcalls
    
    Lock the two TX MO downcalls into driver/firmware in
    lkpi_80211_txq_tx_one() to make sure they cannot happen in the
    middle of other (net80211 triggered) updates calling down into
    the driver/firmware.
    
    Sponsored by:   The FreeBSD Foundation (commit)
    MFC after:      3 days
    Reviewed by:    cc
    Differential Revision: https://reviews.freebsd.org/D43966
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 72b39e840bfd..03b36e6526bd 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -3769,7 +3769,9 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m)
 		    ltxq->txq.tid, ac, skb->priority, skb->qmap);
 #endif
 	LKPI_80211_LTXQ_UNLOCK(ltxq);
+	LKPI_80211_LHW_LOCK(lhw);
 	lkpi_80211_mo_wake_tx_queue(hw, &ltxq->txq);
+	LKPI_80211_LHW_UNLOCK(lhw);
 	return;
 
 ops_tx:
@@ -3782,7 +3784,9 @@ ops_tx:
 #endif
 	memset(&control, 0, sizeof(control));
 	control.sta = sta;
+	LKPI_80211_LHW_LOCK(lhw);
 	lkpi_80211_mo_tx(hw, &control, skb);
+	LKPI_80211_LHW_UNLOCK(lhw);
 }
 
 static void