ath9k: fix a soft lockup on smp systems
authorFelix Fietkau <nbd@openwrt.org>
Mon, 14 Jan 2013 15:59:28 +0000 (15:59 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 14 Jan 2013 15:59:28 +0000 (15:59 +0000)
Backport of r35152

SVN-Revision: 35153

package/mac80211/patches/300-pending_work.patch
package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
package/mac80211/patches/521-ath9k_cur_txpower.patch
package/mac80211/patches/525-ath9k_use_configured_antenna_gain.patch
package/mac80211/patches/562-ath9k_add_idle_hack.patch
package/mac80211/patches/564-ath9k_debugfs_diag.patch
package/mac80211/patches/566-ath9k_use_ieee80211_free_txskb.patch

index c0240ad01e38043927de3926f1002f8de269f237..69c32b8760e2e9c525b9c364c08e0c40e84e4589 100644 (file)
  {
        struct ath_hw *ah = sc->sc_ah;
        bool ret = true;
-@@ -195,19 +195,15 @@ static bool ath_prepare_reset(struct ath
-       ath9k_debug_samp_bb_mac(sc);
-       ath9k_hw_disable_interrupts(ah);
-+      tasklet_disable(&sc->intr_tq);
-+
-       if (!ath_stoprecv(sc))
-               ret = false;
+@@ -201,14 +201,6 @@ static bool ath_prepare_reset(struct ath
        if (!ath_drain_all_txq(sc, retry_tx))
                ret = false;
  
 -      } else {
 -              ath_flushrecv(sc);
 -      }
-+      tasklet_enable(&sc->intr_tq);
+-
        return ret;
  }
-@@ -261,7 +257,6 @@ static int ath_reset_internal(struct ath
+@@ -261,11 +253,11 @@ static int ath_reset_internal(struct ath
        struct ath_common *common = ath9k_hw_common(ah);
        struct ath9k_hw_cal_data *caldata = NULL;
        bool fastcc = true;
        int r;
  
        __ath_cancel_work(sc);
-@@ -275,11 +270,10 @@ static int ath_reset_internal(struct ath
++      tasklet_disable(&sc->intr_tq);
+       spin_lock_bh(&sc->sc_pcu_lock);
+       if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
+@@ -275,11 +267,10 @@ static int ath_reset_internal(struct ath
  
        if (!hchan) {
                fastcc = false;
                fastcc = false;
  
        ath_dbg(common, CONFIG, "Reset to %u MHz, HT40: %d fastcc: %d\n",
-@@ -821,7 +815,7 @@ static void ath9k_stop(struct ieee80211_
+@@ -297,6 +288,8 @@ static int ath_reset_internal(struct ath
+ out:
+       spin_unlock_bh(&sc->sc_pcu_lock);
++      tasklet_enable(&sc->intr_tq);
++
+       return r;
+ }
+@@ -821,7 +814,7 @@ static void ath9k_stop(struct ieee80211_
                ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
        }
  
index db6d36b68e00e8c1bf72f928b1f79d5fc91b4cac..15111e9b827fd2678b71254cc6ad12bc5c264de3 100644 (file)
@@ -80,7 +80,7 @@
  }
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1121,7 +1121,7 @@ static void ath9k_disable_ps(struct ath_
+@@ -1120,7 +1120,7 @@ static void ath9k_disable_ps(struct ath_
        ath_dbg(common, PS, "PowerSave disabled\n");
  }
  
@@ -89,7 +89,7 @@
  {
        struct ath_softc *sc = hw->priv;
        struct ath_hw *ah = sc->sc_ah;
-@@ -1175,9 +1175,11 @@ static int ath9k_config(struct ieee80211
+@@ -1174,9 +1174,11 @@ static int ath9k_config(struct ieee80211
  
        if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
                struct ieee80211_channel *curchan = hw->conf.channel;
  
                if (ah->curchan)
                        old_pos = ah->curchan - &ah->channels[0];
-@@ -1220,7 +1222,23 @@ static int ath9k_config(struct ieee80211
+@@ -1219,7 +1221,23 @@ static int ath9k_config(struct ieee80211
                        memset(&sc->survey[pos], 0, sizeof(struct survey_info));
                }
  
index d740332de3b785b3e0a04c0cc118ff1360c94533..14b59e58e7ce7e397982b2a9b7a31210727d7bc0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1245,6 +1245,8 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1244,6 +1244,8 @@ int ath9k_config(struct ieee80211_hw *hw
                        return -EINVAL;
                }
  
@@ -9,7 +9,7 @@
                /*
                 * The most recent snapshot of channel->noisefloor for the old
                 * channel is only available after the hardware reset. Copy it to
-@@ -1259,6 +1261,7 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1258,6 +1260,7 @@ int ath9k_config(struct ieee80211_hw *hw
                sc->config.txpowlimit = 2 * conf->power_level;
                ath9k_cmn_update_txpow(ah, sc->curtxpow,
                                       sc->config.txpowlimit, &sc->curtxpow);
index 4c34c89684a65777953cd866eb919e6368c1f3c6..367438ea3e45c8a81a76cadae2f1cec89223a5ca 100644 (file)
@@ -21,7 +21,7 @@
        if (ant_gain > max_gain)
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1257,7 +1257,10 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1256,7 +1256,10 @@ int ath9k_config(struct ieee80211_hw *hw
        }
  
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
index ec8bbcef6da71a522f6c34db111e680571d68c8d..7c3c0426bee6b46436543df2d9e248d67a4d7f20 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1081,6 +1081,7 @@ static void ath9k_remove_interface(struc
+@@ -1080,6 +1080,7 @@ static void ath9k_remove_interface(struc
        ath9k_calculate_summary_state(hw, NULL);
  
        mutex_unlock(&sc->mutex);
@@ -8,7 +8,7 @@
        ath9k_ps_restore(sc);
  }
  
-@@ -1133,7 +1134,8 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1132,7 +1133,8 @@ int ath9k_config(struct ieee80211_hw *hw
        mutex_lock(&sc->mutex);
  
        if (changed & IEEE80211_CONF_CHANGE_IDLE) {
index 638d3b58d3ae087906bed16aa72fb01811f8a719..b7d9f5edc56fa3591aa7ec758a3fd5e3b741450f 100644 (file)
  }
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -470,6 +470,11 @@ irqreturn_t ath_isr(int irq, void *dev)
+@@ -469,6 +469,11 @@ irqreturn_t ath_isr(int irq, void *dev)
        ath9k_hw_getisr(ah, &status);   /* NB: clears ISR too */
        status &= ah->imask;    /* discard unasked-for bits */
  
index 20fd408273694e58661dad15e0093ce1c4134a32..3b75ab5da34ae39cb247dce76dbb0fdf65eebfd9 100644 (file)
  
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -769,7 +769,7 @@ static void ath9k_tx(struct ieee80211_hw
+@@ -768,7 +768,7 @@ static void ath9k_tx(struct ieee80211_hw
  
        return;
  exit: