aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/huawei/hinic/hinic_tx.c
diff options
context:
space:
mode:
authorLuo bin <luobin9@huawei.com>2020-03-20 23:13:18 +0000
committerDavid S. Miller <davem@davemloft.net>2020-03-21 19:43:38 -0700
commit33f15da216a1f4566b4ec880942556ace30615df (patch)
treed5404ae2b8b6dfbfbec4c83b47076b66f6b5b356 /drivers/net/ethernet/huawei/hinic/hinic_tx.c
parenthinic: fix the bug of clearing event queue (diff)
downloadwireguard-linux-33f15da216a1f4566b4ec880942556ace30615df.tar.xz
wireguard-linux-33f15da216a1f4566b4ec880942556ace30615df.zip
hinic: fix out-of-order excution in arm cpu
add read barrier in driver code to keep from reading other fileds in dma memory which is writable for hw until we have verified the memory is valid for driver Signed-off-by: Luo bin <luobin9@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/huawei/hinic/hinic_tx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
index 0e13d1c7e474..375d81d03e86 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
@@ -622,6 +622,8 @@ static int free_tx_poll(struct napi_struct *napi, int budget)
do {
hw_ci = HW_CONS_IDX(sq) & wq->mask;
+ dma_rmb();
+
/* Reading a WQEBB to get real WQE size and consumer index. */
sq_wqe = hinic_sq_read_wqebb(sq, &skb, &wqe_size, &sw_ci);
if ((!sq_wqe) ||