From: Maya Erez Date: Mon, 16 May 2016 19:23:31 +0000 (+0300) Subject: wil6210: guarantee safe access to rx descriptors shared memory X-Git-Tag: v4.8-rc1~140^2~279^2^2~25 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ab6d7cc3eab4093caf91ba8b27590c4080d7d01c;p=karo-tx-linux.git 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 Signed-off-by: Kalle Valo --- 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;