aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-10-20 19:07:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-27 15:41:14 -0400
commit7583c550c3e635dcc61ab127c36ecefd59fb8dc8 (patch)
tree6f6ba84e24622bc0c15e81b3510e28bf234a87a9 /drivers/net/wireless/ath
parent1e450285281bdf766272c181ecd43d4f2f0711ce (diff)
ath9k: add locking for starting the PCU on RX
There was some locking for starting some parts of RX but not for starting the PCU. Include this otherwise we can content against stopping the PCU. This can potentially lead to races against different buffers on the PCU which can lead to to the DMA RX engine writing to buffers which are already freed. This is part of a series that will help resolve the bug: https://bugzilla.kernel.org/show_bug.cgi?id=14624 For more details about this issue refer to: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Cc: stable@kernel.org Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index e581b1f6c40c..b3c9baf855c4 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -297,11 +297,11 @@ static void ath_edma_start_recv(struct ath_softc *sc)
297 ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_LP, 297 ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_LP,
298 sc->rx.rx_edma[ATH9K_RX_QUEUE_LP].rx_fifo_hwsize); 298 sc->rx.rx_edma[ATH9K_RX_QUEUE_LP].rx_fifo_hwsize);
299 299
300 spin_unlock_bh(&sc->rx.rxbuflock);
301
302 ath_opmode_init(sc); 300 ath_opmode_init(sc);
303 301
304 ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL)); 302 ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
303
304 spin_unlock_bh(&sc->rx.rxbuflock);
305} 305}
306 306
307static void ath_edma_stop_recv(struct ath_softc *sc) 307static void ath_edma_stop_recv(struct ath_softc *sc)
@@ -504,10 +504,11 @@ int ath_startrecv(struct ath_softc *sc)
504 ath9k_hw_rxena(ah); 504 ath9k_hw_rxena(ah);
505 505
506start_recv: 506start_recv:
507 spin_unlock_bh(&sc->rx.rxbuflock);
508 ath_opmode_init(sc); 507 ath_opmode_init(sc);
509 ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL)); 508 ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
510 509
510 spin_unlock_bh(&sc->rx.rxbuflock);
511
511 return 0; 512 return 0;
512} 513}
513 514