From nobody Tue Jul 21 20:02:00 2026 X-Original-To: dev-commits-src-main@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 4h4Svx3J81z6mNs5 for ; Tue, 21 Jul 2026 20:02:05 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h4Svx254mz3Pjm for ; Tue, 21 Jul 2026 20:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784664125; 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=16fBVCKmiYadM0OOsNlb0/ja7wd9IrhT9TdVKe+BnRU=; b=dR+d0F+T8ii9K1f4IOsqea0s0HlCblHbSEd6wSBvdGc3o1ED7bpcqbOux+QzqxwDQSon26 eZ9q33MBF2CVuHL5XXE8vY096Z2fk+DdyJKuk+ckE+0uc3+yP5ubupmOFttYdGgMY4ul+E 9rpR/WZ4LHgQe6PdnzHM1KPRM0ykclVf25bthb1YOVJUTD0CxJkIOBoGZt5dgexoEw/3NP UlyPsG3irUc1loDtUteidD4/INLuV8txETkX+avqC84RLYe9YH+xBA7etZckSDIekrh30t 2pCw0fWdK38Y6kJ31yc+ROsvwwWwDvHIq/Q8JA4JZuF825zV8yKxUxX1HuyP+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784664125; a=rsa-sha256; cv=none; b=c37cKuhT2fTQBAIghSjHq0s4HMJ5vvBI+al+YRuQmWIztXpfbqDtjtQV0myOmU0Z7bO9Xu b3Mj9vd+s4y0E/+W2YqVjlqbYEYNlNpyHpA4q8ckcXBnIqEu6UoliLr/Vi3qDNVkOXSpWI mCylgZoOdAVjhIVTlmL/vDIbKML7tLU5srluuxmUU+QE5lygjw/19ws1dd2zI92FHt4ant zr2SRD+SU2sWh7BAQfYrximU6Pf+YpLJWuxKh4J5gtcg1ZWcYrtCpcFgfrcz/PntNhJQgr rZ0m/Alg3hP0eF9Y0riqx3ixdGYFy3ONDF1khnBQ8z3XRwICqSkiRbvt4UBQvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784664125; 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=16fBVCKmiYadM0OOsNlb0/ja7wd9IrhT9TdVKe+BnRU=; b=CKg54ZYNAHekNyN0p0X5MrzAMqoK1SWeXpQJmkXjCG7N6Peu1OI345Vv1D/myJM96PKTjw rw2djI2sLykL4l6OU67bzlXqun4wQe8o/wVCHmpQgplH7b1jL2ATTMgPt/IgVqMJjrFvBV qkxsvhuOcwBp5XYWBDwoK7kObik7bTibynrxwHSy6DQw5mpBTu6/cBqsbxLobPYWuWIf8e oe0J818XQaivGmhq2xr5TwlgMFCT5onziktRdnL8Gy8kk1uXcKDh4DJhdeOdtYI985W6Tc aXB7WCmpuv7GtRHROR6gA7beo0Te3R+1CiHhBB1CC1rOPwiUvYWenGcwpi9HMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h4Svx0Mpfz134q for ; Tue, 21 Jul 2026 20:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2223f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Jul 2026 20:02:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 5d479b75a894 - main - LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/main X-Git-Reftype: branch X-Git-Commit: 5d479b75a8944faeabb367d1234a9fc3fefa8df1 Auto-Submitted: auto-generated Date: Tue, 21 Jul 2026 20:02:00 +0000 Message-Id: <6a5fd038.2223f.5fbc89af@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5d479b75a8944faeabb367d1234a9fc3fefa8df1 commit 5d479b75a8944faeabb367d1234a9fc3fefa8df1 Author: Bjoern A. Zeeb AuthorDate: 2026-07-21 19:54:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-07-21 20:00:24 +0000 LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold) We would lock the downcalls during normal operation but not during vap (vif) creation as there was no need for locking. Add the missing locking there as drivers seem to always expect it (by assertion) and cannot distinguish between state. Add the assertions to the downcalls as we need both of them locked and both of them can sleep. PR: 296185 ("rtw89(4) freezes the system with INVARIANTS kernel") Debugged by: Artem Bunichev (temcbun gmail.com) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 ++ sys/compat/linuxkpi/common/src/linux_80211_macops.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 355d0c160472..bf2054c5efd8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4522,11 +4522,13 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); hw->conf.listen_interval = hw->max_listen_interval; + wiphy_lock(hw->wiphy); /* XXX-BZ do we need to be able to update these? */ hw->wiphy->frag_threshold = vap->iv_fragthreshold; lkpi_80211_mo_set_frag_threshold(hw, vap->iv_fragthreshold); hw->wiphy->rts_threshold = vap->iv_rtsthreshold; lkpi_80211_mo_set_rts_threshold(hw, vap->iv_rtsthreshold); + wiphy_unlock(hw->wiphy); /* any others? */ /* Add per-VIF/VAP sysctls. */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index b07a2075491b..09199862dfb7 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -115,6 +115,9 @@ lkpi_80211_mo_set_frag_threshold(struct ieee80211_hw *hw, uint32_t frag_th) struct lkpi_hw *lhw; int error; + might_sleep(); + lockdep_assert_wiphy(hw->wiphy); + lhw = HW_TO_LHW(hw); if (lhw->ops->set_frag_threshold == NULL) { error = EOPNOTSUPP; @@ -135,6 +138,9 @@ lkpi_80211_mo_set_rts_threshold(struct ieee80211_hw *hw, uint32_t rts_th) struct lkpi_hw *lhw; int error; + might_sleep(); + lockdep_assert_wiphy(hw->wiphy); + lhw = HW_TO_LHW(hw); if (lhw->ops->set_rts_threshold == NULL) { error = EOPNOTSUPP;