提交 edd87423 编写于 作者: S Sinan Kaya 提交者: David S. Miller

bnx2x: Replace doorbell barrier() with wmb()

barrier() doesn't guarantee memory writes to be observed by the hardware on
all architectures. barrier() only tells compiler not to move this code
with respect to other read/writes.

If memory write needs to be observed by the HW, wmb() is the right choice.
Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f9442ac4
......@@ -4153,7 +4153,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
txdata->tx_db.data.prod += nbd;
barrier();
/* make sure descriptor update is observed by HW */
wmb();
DOORBELL(bp, txdata->cid, txdata->tx_db.raw);
......
......@@ -2591,7 +2591,8 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode)
wmb();
txdata->tx_db.data.prod += 2;
barrier();
/* make sure descriptor update is observed by the HW */
wmb();
DOORBELL(bp, txdata->cid, txdata->tx_db.raw);
mmiowb();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册