aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-07-13 21:53:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-14 13:52:46 -0400
commitb3f194e54bdbaa4d508488cab24d23c376e235a2 (patch)
treee8834673a23dbbb5b71955084305568229788acf /drivers
parent450464def78c94018d997ae6f823578499cdf879 (diff)
ath5k: clean up rxlink handling
There were a few places where the sc->rxlink pointer was set to NULL "just in case". This helps nothing - quite to the contrary it is problematic since it can create self-linked rx descriptors in the middle of the list of receive buffers. Here is an example how this could happen (thanks Bob!): cpu 0: cpu 1: ath5k_rx_stop ath5k_tasklet_rx sc->rxlink = NULL; /* just in case */ // following doesn't link used // buffer to prev. ath5k_rxbuf_setup() In the case of ath5k_rx_stop() and ath5k_stop_locked() buffers/descriptors are not changed so rxlink should not be changed as well. In ath5k_intr() we seem to try to work around a hardware bug, as the comment (which is copied 1:1 from the HAL) suggests. I don't see how this could help. Also the HAL does not set rxlink in this case (So where does this code come from? It has been there since the first import of ath5k). Changed to just increment a statistics counter. After this patch rxlink is only set to NULL before we initialize rx descriptors and updated when the descriptors are linked together. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c7
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h1
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index b0e1ca99fcad..0d5de2574dd1 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1728,8 +1728,6 @@ ath5k_rx_stop(struct ath5k_softc *sc)
1728 ath5k_hw_stop_rx_dma(ah); /* disable DMA engine */ 1728 ath5k_hw_stop_rx_dma(ah); /* disable DMA engine */
1729 1729
1730 ath5k_debug_printrxbuffs(sc, ah); 1730 ath5k_debug_printrxbuffs(sc, ah);
1731
1732 sc->rxlink = NULL; /* just in case */
1733} 1731}
1734 1732
1735static unsigned int 1733static unsigned int
@@ -2633,8 +2631,7 @@ ath5k_stop_locked(struct ath5k_softc *sc)
2633 if (!test_bit(ATH_STAT_INVALID, sc->status)) { 2631 if (!test_bit(ATH_STAT_INVALID, sc->status)) {
2634 ath5k_rx_stop(sc); 2632 ath5k_rx_stop(sc);
2635 ath5k_hw_phy_disable(ah); 2633 ath5k_hw_phy_disable(ah);
2636 } else 2634 }
2637 sc->rxlink = NULL;
2638 2635
2639 return 0; 2636 return 0;
2640} 2637}
@@ -2771,7 +2768,7 @@ ath5k_intr(int irq, void *dev_id)
2771 * RXE bit is written, but it doesn't work at 2768 * RXE bit is written, but it doesn't work at
2772 * least on older hardware revs. 2769 * least on older hardware revs.
2773 */ 2770 */
2774 sc->rxlink = NULL; 2771 sc->stats.rxeol_intr++;
2775 } 2772 }
2776 if (status & AR5K_INT_TXURN) { 2773 if (status & AR5K_INT_TXURN) {
2777 /* bump tx trigger level */ 2774 /* bump tx trigger level */
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 86c90f471b74..dc1241f9c4e8 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -137,6 +137,7 @@ struct ath5k_statistics {
137 137
138 unsigned int mib_intr; 138 unsigned int mib_intr;
139 unsigned int rxorn_intr; 139 unsigned int rxorn_intr;
140 unsigned int rxeol_intr;
140}; 141};
141 142
142#if CHAN_DEBUG 143#if CHAN_DEBUG