aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wcn36xx/dxe.h
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2015-10-24 13:42:15 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-10-28 20:58:06 +0200
commit8e8e54c490032f15779d7b199548eb0143b70f0f (patch)
tree01fa15ec47331fbd1dbe6ed306d2e7998d3555ad /drivers/net/wireless/ath/wcn36xx/dxe.h
parentath9k: fix phyerror codes (diff)
downloadlinux-dev-8e8e54c490032f15779d7b199548eb0143b70f0f.tar.xz
linux-dev-8e8e54c490032f15779d7b199548eb0143b70f0f.zip
wcn36xx: introduce per-channel ring buffer locks
wcn36xx implements a ring buffer for transmitted frames for each (high and low priority) DMA channel. The ring buffers are lockless: new frames are inserted at the head of the queue, while finished packets are reaped from the tail. Unfortunately, the list manipulations are missing any kind of barriers so are susceptible to various races: for example, a TX completion handler might read an updated desc->ctrl before the head has actually advanced, and then null out the ctl->skb pointer while it is still being used in the TX path. Simplify things here by adding a spin lock when traversing the ring. This change increased stability for me without adding any noticeable overhead on my platform (xperia z). Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/wireless/ath/wcn36xx/dxe.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h b/drivers/net/wireless/ath/wcn36xx/dxe.h
index 35ee7e966bd2..3eca4f9594f2 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.h
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.h
@@ -243,6 +243,7 @@ struct wcn36xx_dxe_ctl {
};
struct wcn36xx_dxe_ch {
+ spinlock_t lock; /* protects head/tail ptrs */
enum wcn36xx_dxe_ch_type ch_type;
void *cpu_addr;
dma_addr_t dma_addr;