]> git.baikalelectronics.ru Git - kernel.git/commit
wcn36xx: introduce per-channel ring buffer locks
authorBob Copeland <me@bobcopeland.com>
Sat, 24 Oct 2015 17:42:15 +0000 (13:42 -0400)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 28 Oct 2015 18:58:06 +0000 (20:58 +0200)
commit5afa6f3003d1cb589c22e8d331555c9c80cfdd96
tree01fa15ec47331fbd1dbe6ed306d2e7998d3555ad
parentbadd1c92f94c1844e87e6911b79f7a35e12d436a
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>
drivers/net/wireless/ath/wcn36xx/dxe.c
drivers/net/wireless/ath/wcn36xx/dxe.h