summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaya Erez <qca_merez@qca.qualcomm.com>2016-05-16 21:23:31 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2016-05-28 10:19:13 +0200
commitab6d7cc3eab4093caf91ba8b27590c4080d7d01c (patch)
treed5e936d8fe4d24ebb9b56893e1f8584b49ad2f20
parentwil6210: fix race conditions between TX send and completion (diff)
downloadlinux-ab6d7cc3eab4093caf91ba8b27590c4080d7d01c.tar.xz
linux-ab6d7cc3eab4093caf91ba8b27590c4080d7d01c.zip
wil6210: guarantee safe access to rx descriptors shared memory
add memory barrier after allocating new rx descriptors, before updating the hwtail. This will guarantee that all writes to descriptors (shared memory) are done before committing them to HW. Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index fa6ea24a1309..3909af171bad 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -544,6 +544,12 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count)
break;
}
}
+
+ /* make sure all writes to descriptors (shared memory) are done before
+ * committing them to HW
+ */
+ wmb();
+
wil_w(wil, v->hwtail, v->swtail);
return rc;