Date: Mon, 27 Jul 2026 00:10:43 +0000
From: Bjoern A. Zeeb <bz@FreeBSD.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject: git: 94ab8de14f0a - stable/15 - LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold)
Message-ID: <6a66a203.27726.234d00b4@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=94ab8de14f0a8fd07b3f1e216ec3f42a8d51ccaf commit 94ab8de14f0a8fd07b3f1e216ec3f42a8d51ccaf Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2026-07-21 19:54:04 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2026-07-26 16:48:40 +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 (cherry picked from commit 5d479b75a8944faeabb367d1234a9fc3fefa8df1) --- 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 df6d7c3158b3..0c649bfcbc80 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4516,11 +4516,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;home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a66a203.27726.234d00b4>
