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 054c5ddf58 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
This commit is contained in:
Bjoern A. Zeeb 2025-02-22 23:38:54 +00:00
parent 72ee3d57f3
commit 65c573e47c

View file

@ -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);