From nobody Fri Jan 16 19:40:41 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dt9F62VrTz6NlKT for ; Fri, 16 Jan 2026 19:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dt9F601R6z3ww7 for ; Fri, 16 Jan 2026 19:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81Wbe8vSK3TBapHfxR3KLArJVx2yuoZZJ/JO+MGt4jM=; b=ucJJNBylVXyC1R5htRA0CmGsZqAuLA+cij74XzoITjH+q57GE+haDD2CUZiXYk9acsAhTF lyYGxpAcaUV1eo+GhynbXFQDxAT3IgbXLBay2mxoVQMDAKEVQc7lGRvDbPO1Z/pZGCsu8Z XUIQBEqXbFUvc6IQj9yK7o5URlosw8TfrXTNA1GMn9x6kSC1EX7ecclRTSxFvspnXnZzh6 f/yUYOpBLDL+rrhQlMbmUfhCOFish6CCZgzVWYrRRTK8lvu7yILP9tR/t54MC+zRFGh0dz 8ETnNi6+7Auoiz3gsIxQHewfSZb5tSCfzSPIf4yS/g6AwEoEvttOHsVygsqGow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81Wbe8vSK3TBapHfxR3KLArJVx2yuoZZJ/JO+MGt4jM=; b=i7dNLQNUTC+t2G9Q5OkpBbKyLtJMFvQ5mjQfE2ERSMUN/C/RhpwgM+ndloVI/cU5Sluyif yCvY+7fh9B5WUx+BcJYS2aolzJagkOGg8kXwQyUkHykYtU29Rnz7uZYhUGcO6j4UH/yO/K p7m4YtmM63rPPWYR0SVxaWmAeQ4Wn58FbErKx7aL+sXM0LtcUgvggXhprBnvTkBEudICXB zPghhZLgiqrDyQjPXZOeB8CoRm7SYyM2rQWn1DQspgvNIbs2imwWXeoZeUL5aNrOBsMlOG 8WYCviFylXG5rKuVFi1MGnQOq41uPc8RYl9E6ZGX7GBrBUpBWYFSgzwd+Y5n/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768592442; a=rsa-sha256; cv=none; b=NLkzrtVMdJB3Pg5acc3Ex+Ww7WdbudG/k+Z+lu7WK3EG7WeIzf6QYdY0cY5DPnYKMnJrYS BnVo5NlexZ7gR9nWMnwBCiaYuCCGq+w1/Ng/mmw0aSfsgJYw41OehBpKUUrBqUHTPuhBaE C8/NbvKRYcemtOJ90jt7B3ZyYeROsSwxROANGxV63khwwcrrVAv8a7P4KYSsI0HNAubD1U ewbrZJY5HfDtH3ry6uPTPHFD7nBss7JqZ/EjMi9qfBkbHyw+iX0ynw0YAsONH64AnDwdVp v5TE7RZXEUMin2OVi5vO1Ey+1hbB65TM3FOcI8shO1/QJ6G3QqCDIgOJzgCinA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dt9F56TRJzCJr for ; Fri, 16 Jan 2026 19:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e13c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 16 Jan 2026 19:40:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 8121f688bb55 - stable/14 - LinuxKPI: 802.11: adjust lower wake_queue locking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8121f688bb550af894b4b1b3ff66dba283ac16d5 Auto-Submitted: auto-generated Date: Fri, 16 Jan 2026 19:40:41 +0000 Message-Id: <696a9439.e13c.58689437@gitrepo.freebsd.org> The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8121f688bb550af894b4b1b3ff66dba283ac16d5 commit 8121f688bb550af894b4b1b3ff66dba283ac16d5 Author: Bjoern A. Zeeb AuthorDate: 2025-08-29 07:39:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-01-16 19:37:45 +0000 LinuxKPI: 802.11: adjust lower wake_queue locking In bc24342d96aa8 we added lower wake_queue locking. There are paths, such as in rtw89 from a (*hw_scan_cancel)() that we can get to there and then would recursively acquire the wiphy lock which is not allowed. Adjust locking to a spin lock to match Linux driver expectations. Sponsored by: The FreeBSD Foundation Fixes: bc24342d96aa8 (cherry picked from commit fc36de571f11abda5cc68a4abd963053f676f8c5) --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 +++++++++++++++---- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7461b5db940a..17279f3caf6c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5959,6 +5959,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) LKPI_80211_LHW_SCAN_LOCK_INIT(lhw); LKPI_80211_LHW_TXQ_LOCK_INIT(lhw); + spin_lock_init(&lhw->txq_lock); sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK); TAILQ_INIT(&lhw->lvif_head); for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { @@ -6058,6 +6059,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) } /* Cleanup more of lhw here or in wiphy_free()? */ + spin_lock_destroy(&lhw->txq_lock); LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw); sx_destroy(&lhw->lvif_sx); @@ -8027,21 +8029,30 @@ lkpi_ieee80211_wake_queues_locked(struct ieee80211_hw *hw) void linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *hw) { - wiphy_lock(hw->wiphy); + struct lkpi_hw *lhw; + unsigned long flags; + + lhw = HW_TO_LHW(hw); + + spin_lock_irqsave(&lhw->txq_lock, flags); lkpi_ieee80211_wake_queues_locked(hw); - wiphy_unlock(hw->wiphy); + spin_unlock_irqrestore(&lhw->txq_lock, flags); } void linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) { + struct lkpi_hw *lhw; + unsigned long flags; KASSERT(qnum < hw->queues, ("%s: qnum %d >= hw->queues %d, hw %p\n", __func__, qnum, hw->queues, hw)); - wiphy_lock(hw->wiphy); + lhw = HW_TO_LHW(hw); + + spin_lock_irqsave(&lhw->txq_lock, flags); lkpi_ieee80211_wake_queues(hw, qnum); - wiphy_unlock(hw->wiphy); + spin_unlock_irqrestore(&lhw->txq_lock, flags); } /* This is just hardware queues. */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 89afec1235bd..eb7bae811695 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -227,6 +227,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; + spinlock_t txq_lock; /* Deferred RX path. */ struct task rxq_task;