Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764031AbZCaXah (ORCPT ); Tue, 31 Mar 2009 19:30:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763520AbZCaXUz (ORCPT ); Tue, 31 Mar 2009 19:20:55 -0400 Received: from sous-sol.org ([216.99.217.87]:33207 "EHLO x200.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1763403AbZCaXUx (ORCPT ); Tue, 31 Mar 2009 19:20:53 -0400 Message-Id: <20090331231523.458171337@sous-sol.org> User-Agent: quilt/0.47-1 Date: Tue, 31 Mar 2009 16:11:02 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Bob Copeland , John W Linville Subject: [patch 17/45] ath5k: use spin_lock_irqsave for beacon lock References: <20090331231045.719396245@sous-sol.org> Content-Disposition: inline; filename=ath5k-use-spin_lock_irqsave-for-beacon-lock.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 58 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Bob Copeland 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 --- drivers/net/wireless/ath5k/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- 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 } } - 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 * 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/