diff options
author | Luo bin <luobin9@huawei.com> | 2020-03-21 02:13:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-22 05:43:38 +0300 |
commit | 33f15da216a1f4566b4ec880942556ace30615df (patch) | |
tree | d5404ae2b8b6dfbfbec4c83b47076b66f6b5b356 /drivers/net/ethernet/huawei/hinic/hinic_rx.c | |
parent | 614eaa943e9fc3fcdbd4aa0692ae84973d363333 (diff) | |
download | linux-33f15da216a1f4566b4ec880942556ace30615df.tar.xz |
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 'drivers/net/ethernet/huawei/hinic/hinic_rx.c')
-rw-r--r-- | drivers/net/ethernet/huawei/hinic/hinic_rx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c index 2695ad69fca6..815649e37cb1 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c @@ -350,6 +350,9 @@ static int rxq_recv(struct hinic_rxq *rxq, int budget) if (!rq_wqe) break; + /* make sure we read rx_done before packet length */ + dma_rmb(); + cqe = rq->cqe[ci]; status = be32_to_cpu(cqe->status); hinic_rq_get_sge(rxq->rq, rq_wqe, ci, &sge); |