wil6210: make sure DR bit is read before rest of the status message
authorDedy Lansky <dlansky@codeaurora.org>
Tue, 10 Sep 2019 13:46:29 +0000 (16:46 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 12 Sep 2019 15:06:53 +0000 (18:06 +0300)
commitf4519fd9375d310c608f9a47e4f3a0579bc94998
treed8c94c105a1d4f0a685888dc03226ff218ea2210
parent42fe1e519e9f1c6f554c0183f8c9cdd92036cbbf
wil6210: make sure DR bit is read before rest of the status message

Due to compiler optimization, it's possible that dr_bit (descriptor
ready) is read last from the status message.
Due to race condition between HW writing the status message and
driver reading it, other fields that were read earlier (before dr_bit)
could have invalid values.

Fix this by explicitly reading the dr_bit first and then using rmb
before reading the rest of the status message.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wil6210/txrx_edma.c
drivers/net/wireless/ath/wil6210/txrx_edma.h