]> git.karo-electronics.de Git - linux-beck.git/commitdiff
wil6210: guarantee safe access to rx descriptors shared memory
authorMaya Erez <qca_merez@qca.qualcomm.com>
Mon, 16 May 2016 19:23:31 +0000 (22:23 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Sat, 28 May 2016 08:19:13 +0000 (11:19 +0300)
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>
drivers/net/wireless/ath/wil6210/txrx.c

index fa6ea24a1309ed5b35e5eaaec0abb06f96b86cff..3909af171badee2e62cb20b750be0aa1f7e36862 100644 (file)
@@ -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;