1
From 7583c550c3e635dcc61ab127c36ecefd59fb8dc8 Mon Sep 17 00:00:00 2001
2
From: Luis R. Rodriguez <lrodriguez@atheros.com>
3
Date: Wed, 20 Oct 2010 16:07:04 -0700
4
Subject: [PATCH 40/44] ath9k: add locking for starting the PCU on RX
6
There was some locking for starting some parts of
7
RX but not for starting the PCU. Include this otherwise
8
we can content against stopping the PCU.
10
This can potentially lead to races against different
11
buffers on the PCU which can lead to to the DMA RX
12
engine writing to buffers which are already freed.
14
This is part of a series that will help resolve the bug:
16
https://bugzilla.kernel.org/show_bug.cgi?id=14624
18
For more details about this issue refer to:
20
http://marc.info/?l=linux-wireless&m=128629803703756&w=2
23
Cc: Ben Greear <greearb@candelatech.com>
24
Cc: Kyungwan Nam <kyungwan.nam@atheros.com>
25
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
26
Tested-by: Ben Greear <greearb@candelatech.com>
27
Signed-off-by: John W. Linville <linville@tuxdriver.com>
29
drivers/net/wireless/ath/ath9k/recv.c | 7 ++++---
30
1 files changed, 4 insertions(+), 3 deletions(-)
32
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
33
index e581b1f..b3c9baf 100644
34
--- a/drivers/net/wireless/ath/ath9k/recv.c
35
+++ b/drivers/net/wireless/ath/ath9k/recv.c
36
@@ -297,11 +297,11 @@ static void ath_edma_start_recv(struct ath_softc *sc)
37
ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_LP,
38
sc->rx.rx_edma[ATH9K_RX_QUEUE_LP].rx_fifo_hwsize);
40
- spin_unlock_bh(&sc->rx.rxbuflock);
44
ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
46
+ spin_unlock_bh(&sc->rx.rxbuflock);
49
static void ath_edma_stop_recv(struct ath_softc *sc)
50
@@ -504,10 +504,11 @@ int ath_startrecv(struct ath_softc *sc)
54
- spin_unlock_bh(&sc->rx.rxbuflock);
56
ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
58
+ spin_unlock_bh(&sc->rx.rxbuflock);