Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4668cce5 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath9k: disable the tasklet before taking the PCU lock



Fixes a reported CPU soft lockup where the tasklet tries to acquire the
lock and blocks while ath_prepare_reset (holding the lock) waits for it
to complete.

Cc: stable@vger.kernel.org
Reported-by: default avatarRobert Shade <robert.shade@gmail.com>
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 463e3ed3
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -196,16 +196,12 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx)
	ath9k_debug_samp_bb_mac(sc);
	ath9k_debug_samp_bb_mac(sc);
	ath9k_hw_disable_interrupts(ah);
	ath9k_hw_disable_interrupts(ah);


	tasklet_disable(&sc->intr_tq);

	if (!ath_stoprecv(sc))
	if (!ath_stoprecv(sc))
		ret = false;
		ret = false;


	if (!ath_drain_all_txq(sc, retry_tx))
	if (!ath_drain_all_txq(sc, retry_tx))
		ret = false;
		ret = false;


	tasklet_enable(&sc->intr_tq);

	return ret;
	return ret;
}
}


@@ -262,6 +258,7 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,


	__ath_cancel_work(sc);
	__ath_cancel_work(sc);


	tasklet_disable(&sc->intr_tq);
	spin_lock_bh(&sc->sc_pcu_lock);
	spin_lock_bh(&sc->sc_pcu_lock);


	if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
	if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
@@ -296,6 +293,8 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,


out:
out:
	spin_unlock_bh(&sc->sc_pcu_lock);
	spin_unlock_bh(&sc->sc_pcu_lock);
	tasklet_enable(&sc->intr_tq);

	return r;
	return r;
}
}