aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2025-02-22 23:38:54 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2025-02-23 00:36:50 +0000
commit65c573e47c40e3f167f3d7e41bd8db40b6b8f91e (patch)
treef73bc85f32f3f04ce147b61cba35f92236083653
parent72ee3d57f31eff420948048ba3c6afdefe4aab5b (diff)
LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop()
net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)(). Make use of 054c5ddf587a7 and conditionally check if the caller locked or not and if locked temporary drop the lock to avoid sleeping on a non-sleepaable lock during the downcall into the driver. Sponsored by: The FreeBSD Foundation MFC after: 3 days
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 62d29feabb09..8daa2fa4dc8e 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -5024,6 +5024,7 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
struct ieee80211_ampdu_params params = { };
int error;
uint8_t tid;
+ bool ic_locked;
ic = ni->ni_ic;
lhw = ic->ic_softc;
@@ -5061,11 +5062,14 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
params.tid = tid;
params.amsdu = false;
- // IEEE80211_UNLOCK(ic);
+ ic_locked = IEEE80211_IS_LOCKED(ic);
+ if (ic_locked)
+ IEEE80211_UNLOCK(ic);
LKPI_80211_LHW_LOCK(lhw);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
LKPI_80211_LHW_UNLOCK(lhw);
- // IEEE80211_LOCK(ic);
+ if (ic_locked)
+ IEEE80211_LOCK(ic);
if (error != 0)
ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n",
__func__, error, ni, rap);