2013-01-14 15:56:57

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 3.8] 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: [email protected]
Reported-by: Robert Shade <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 17a5eec..0fb53d6 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -196,16 +196,12 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx)
ath9k_debug_samp_bb_mac(sc);
ath9k_hw_disable_interrupts(ah);

- tasklet_disable(&sc->intr_tq);
-
if (!ath_stoprecv(sc))
ret = false;

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

- tasklet_enable(&sc->intr_tq);
-
return ret;
}

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

__ath_cancel_work(sc);

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

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:
spin_unlock_bh(&sc->sc_pcu_lock);
+ tasklet_enable(&sc->intr_tq);
+
return r;
}

--
1.8.0.2



2013-01-14 22:54:17

by Robert Shade

[permalink] [raw]
Subject: Re: [PATCH 3.8] ath9k: disable the tasklet before taking the PCU lock

Thanks for the quick turnaround. I've been testing it for 6+ hrs now
with no issue.

On Mon, Jan 14, 2013 at 10:56 AM, Felix Fietkau <[email protected]> wrote:
> 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: [email protected]
> Reported-by: Robert Shade <[email protected]>
> Signed-off-by: Felix Fietkau <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/main.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 17a5eec..0fb53d6 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -196,16 +196,12 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx)
> ath9k_debug_samp_bb_mac(sc);
> ath9k_hw_disable_interrupts(ah);
>
> - tasklet_disable(&sc->intr_tq);
> -
> if (!ath_stoprecv(sc))
> ret = false;
>
> if (!ath_drain_all_txq(sc, retry_tx))
> ret = false;
>
> - tasklet_enable(&sc->intr_tq);
> -
> return ret;
> }
>
> @@ -262,6 +258,7 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,
>
> __ath_cancel_work(sc);
>
> + tasklet_disable(&sc->intr_tq);
> spin_lock_bh(&sc->sc_pcu_lock);
>
> 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:
> spin_unlock_bh(&sc->sc_pcu_lock);
> + tasklet_enable(&sc->intr_tq);
> +
> return r;
> }
>
> --
> 1.8.0.2
>