From: Felix Fietkau Date: Mon, 14 Jan 2013 09:51:53 +0000 (+0000) Subject: ath9k: remove a lock to fix a deadlock on hw reset X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fca519e06da8a0268efc1fa20bdcdccb6497fe96;p=openwrt%2Fstaging%2Fdangole.git ath9k: remove a lock to fix a deadlock on hw reset SVN-Revision: 35147 --- diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index 4d288bf602..f7b2540272 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -237,7 +237,15 @@ WLAN_STA_BLOCK_BA, --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -324,7 +324,6 @@ struct ath_rx { +@@ -314,7 +314,6 @@ struct ath_rx { + u32 *rxlink; + u32 num_pkts; + unsigned int rxfilter; +- spinlock_t rxbuflock; + struct list_head rxbuf; + struct ath_descdma rxdma; + struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX]; +@@ -324,7 +323,6 @@ struct ath_rx { int ath_startrecv(struct ath_softc *sc); bool ath_stoprecv(struct ath_softc *sc); @@ -245,7 +253,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc); int ath_rx_init(struct ath_softc *sc, int nbufs); void ath_rx_cleanup(struct ath_softc *sc); -@@ -641,7 +640,6 @@ void ath_ant_comb_update(struct ath_soft +@@ -641,7 +639,6 @@ void ath_ant_comb_update(struct ath_soft enum sc_op_flags { SC_OP_INVALID, SC_OP_BEACONS, @@ -365,15 +373,47 @@ dev_kfree_skb_any(sc->rx.frag); --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -280,7 +280,6 @@ int ath_rx_init(struct ath_softc *sc, in +@@ -248,8 +248,6 @@ rx_init_fail: + + static void ath_edma_start_recv(struct ath_softc *sc) + { +- spin_lock_bh(&sc->rx.rxbuflock); +- + ath9k_hw_rxena(sc->sc_ah); + + ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_HP, +@@ -261,8 +259,6 @@ static void ath_edma_start_recv(struct a + ath_opmode_init(sc); + + ath9k_hw_startpcureceive(sc->sc_ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)); +- +- spin_unlock_bh(&sc->rx.rxbuflock); + } + + static void ath_edma_stop_recv(struct ath_softc *sc) +@@ -279,8 +275,6 @@ int ath_rx_init(struct ath_softc *sc, in + int error = 0; spin_lock_init(&sc->sc_pcu_lock); - spin_lock_init(&sc->rx.rxbuflock); +- spin_lock_init(&sc->rx.rxbuflock); - clear_bit(SC_OP_RXFLUSH, &sc->sc_flags); common->rx_bufsize = IEEE80211_MAX_MPDU_LEN / 2 + sc->sc_ah->caps.rx_status_len; -@@ -464,6 +463,13 @@ start_recv: +@@ -438,7 +432,6 @@ int ath_startrecv(struct ath_softc *sc) + return 0; + } + +- spin_lock_bh(&sc->rx.rxbuflock); + if (list_empty(&sc->rx.rxbuf)) + goto start_recv; + +@@ -459,26 +452,31 @@ start_recv: + ath_opmode_init(sc); + ath9k_hw_startpcureceive(ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)); + +- spin_unlock_bh(&sc->rx.rxbuflock); +- return 0; } @@ -387,7 +427,10 @@ bool ath_stoprecv(struct ath_softc *sc) { struct ath_hw *ah = sc->sc_ah; -@@ -474,6 +480,8 @@ bool ath_stoprecv(struct ath_softc *sc) + bool stopped, reset = false; + +- spin_lock_bh(&sc->rx.rxbuflock); + ath9k_hw_abortpcurecv(ah); ath9k_hw_setrxfilter(ah, 0); stopped = ath9k_hw_stopdmarecv(ah, &reset); @@ -396,7 +439,12 @@ if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) ath_edma_stop_recv(sc); else -@@ -490,15 +498,6 @@ bool ath_stoprecv(struct ath_softc *sc) + sc->rx.rxlink = NULL; +- spin_unlock_bh(&sc->rx.rxbuflock); + + if (!(ah->ah_flags & AH_UNPLUGGED) && + unlikely(!stopped)) { +@@ -490,15 +488,6 @@ bool ath_stoprecv(struct ath_softc *sc) return stopped && !reset; } @@ -412,7 +460,7 @@ static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb) { /* Check whether the Beacon frame has DTIM indicating buffered bc/mc */ -@@ -735,6 +734,7 @@ static struct ath_buf *ath_get_next_rx_b +@@ -735,6 +724,7 @@ static struct ath_buf *ath_get_next_rx_b return NULL; } @@ -420,7 +468,14 @@ if (!bf->bf_mpdu) return bf; -@@ -1057,9 +1057,6 @@ int ath_rx_tasklet(struct ath_softc *sc, +@@ -1050,16 +1040,12 @@ int ath_rx_tasklet(struct ath_softc *sc, + dma_type = DMA_FROM_DEVICE; + + qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; +- spin_lock_bh(&sc->rx.rxbuflock); + + tsf = ath9k_hw_gettsf64(ah); + tsf_lower = tsf & 0xffffffff; do { bool decrypt_error = false; @@ -430,7 +485,7 @@ memset(&rs, 0, sizeof(rs)); if (edma) -@@ -1102,15 +1099,6 @@ int ath_rx_tasklet(struct ath_softc *sc, +@@ -1102,15 +1088,6 @@ int ath_rx_tasklet(struct ath_softc *sc, ath_debug_stat_rx(sc, &rs); @@ -446,7 +501,7 @@ memset(rxs, 0, sizeof(struct ieee80211_rx_status)); rxs->mactime = (tsf & ~0xffffffffULL) | rs.rs_tstamp; -@@ -1245,14 +1233,15 @@ requeue_drop_frag: +@@ -1245,19 +1222,18 @@ requeue_drop_frag: sc->rx.frag = NULL; } requeue: @@ -466,6 +521,11 @@ } } while (1); +- spin_unlock_bh(&sc->rx.rxbuflock); +- + if (!(ah->imask & ATH9K_INT_RXEOL)) { + ah->imask |= (ATH9K_INT_RXEOL | ATH9K_INT_RXORN); + ath9k_hw_set_interrupts(ah); --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -4586,14 +4586,14 @@ static int ar9003_hw_cal_pier_get(struct diff --git a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch index 73ffc8b3b9..4d20502d13 100644 --- a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch +++ b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -672,6 +672,7 @@ struct ath_softc { +@@ -671,6 +671,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; @@ -8,7 +8,7 @@ struct survey_info *cur_survey; struct survey_info survey[ATH9K_NUM_CHANNELS]; -@@ -744,6 +745,7 @@ struct ath_softc { +@@ -743,6 +744,7 @@ struct ath_softc { #endif }; diff --git a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch index bafb9d8874..c84a7ad04b 100644 --- a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch +++ b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch @@ -135,7 +135,7 @@ u8 rs_num_delims; --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -946,6 +946,7 @@ static int ath9k_rx_skb_preprocess(struc +@@ -936,6 +936,7 @@ static int ath9k_rx_skb_preprocess(struc bool *decrypt_error) { struct ath_hw *ah = common->ah; @@ -143,7 +143,7 @@ /* * everything but the rate is checked here, the rate check is done -@@ -971,6 +972,20 @@ static int ath9k_rx_skb_preprocess(struc +@@ -961,6 +962,20 @@ static int ath9k_rx_skb_preprocess(struc if (rx_stats->rs_moreaggr) rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; diff --git a/package/mac80211/patches/530-ath9k_extra_leds.patch b/package/mac80211/patches/530-ath9k_extra_leds.patch index 7eddd3f82f..42820b169e 100644 --- a/package/mac80211/patches/530-ath9k_extra_leds.patch +++ b/package/mac80211/patches/530-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -550,6 +550,9 @@ struct ath9k_wow_pattern { +@@ -549,6 +549,9 @@ struct ath9k_wow_pattern { void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); void ath_fill_led_pin(struct ath_softc *sc); @@ -10,7 +10,7 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -668,6 +671,13 @@ struct ath9k_vif_iter_data { +@@ -667,6 +670,13 @@ struct ath9k_vif_iter_data { int nadhocs; /* number of adhoc vifs */ }; @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -709,9 +719,8 @@ struct ath_softc { +@@ -708,9 +718,8 @@ struct ath_softc { struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; #ifdef CONFIG_MAC80211_LEDS