From: Bob Copeland Date: Thu, 26 Mar 2009 23:05:28 +0000 (+0000) Subject: ath5k: use spin_lock_irqsave for beacon lock X-Git-Tag: v2.6.29.1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bc20526fc862d18997fd6f267a985d428fbc6e5;p=thirdparty%2Fkernel%2Fstable.git ath5k: use spin_lock_irqsave for beacon lock upstream commit: b5f03956c56d72ad336e5c2c42a025f25d952c30 ath5k_reset can be called from process context, which in turn can call ath5k_beacon_config which takes the sc->block spinlock. Since it can also be taken in hard irq context, use spin_lock_irqsave everywhere. This fixes a potential deadlock in adhoc mode. Changes-licensed-under: 3-Clause-BSD Cc: stable@kernel.org Signed-off-by: Bob Copeland Signed-off-by: John W. Linville Signed-off-by: Chris Wright --- diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 1d77ee9d6e993..16f207c996c7b 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c @@ -1668,7 +1668,6 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb, } } - static void ath5k_tasklet_rx(unsigned long data) { @@ -2188,6 +2187,7 @@ static void ath5k_beacon_config(struct ath5k_softc *sc) { struct ath5k_hw *ah = sc->ah; + unsigned long flags; ath5k_hw_set_imr(ah, 0); sc->bmisscount = 0; @@ -2211,9 +2211,9 @@ ath5k_beacon_config(struct ath5k_softc *sc) if (sc->opmode == NL80211_IFTYPE_ADHOC) { if (ath5k_hw_hasveol(ah)) { - spin_lock(&sc->block); + spin_lock_irqsave(&sc->block, flags); ath5k_beacon_send(sc); - spin_unlock(&sc->block); + spin_unlock_irqrestore(&sc->block, flags); } } else ath5k_beacon_update_timers(sc, -1);