git: 50a078f852ab - stable/13 - LinuxKPI: 802.11 fix queue wait

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 09 Jan 2022 02:39:55 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=50a078f852abd5fd0b8222c609603791dfbc79ee

commit 50a078f852abd5fd0b8222c609603791dfbc79ee
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-12-31 11:47:14 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-01-09 02:37:01 +0000

    LinuxKPI: 802.11 fix queue wait
    
    We are using a bandaid to wait for queues after station creation
    looping and pausing.
    The abort condition was looping in the wrong direction so we were
    potentially waiting forever if queues never became ready.
    From initial user test data we also found that the wait time was
    too low in some cases so increase the length.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 500be2e803377e6fe3aa1600e6d55326bbbb4ae4)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index f38997225185..5df10458f3de 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -786,7 +786,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 	{
 		int i, count;
 
-		for (i = 3; i > 0; i++) {
+		for (i = 3 * (hw->queues + 1); i > 0; i--) {
 			struct lkpi_txq *ltxq;
 			int tid;
 
@@ -815,7 +815,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 				ic_printf(vap->iv_ic, "%s: waiting for %d quuees "
 				    "to be allocated by driver\n", __func__, count);
 #endif
-			DELAY(100);
+			pause("lkpi80211txq", hz/10);
 		}
 #ifdef LINUXKPI_DEBUG_80211
 		if (count > 0)