diff options
author | Vlad Zolotarov <vlad@scalemp.com> | 2012-02-05 19:24:39 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-06 07:42:00 +0400 |
commit | 94bf91baf3a16ec274de3cd913be3033c029f853 (patch) | |
tree | 228947bbd33977940a8262512072528a64cdfa30 /drivers | |
parent | b033281f618fa40ee1b24a60cd8043b4979bfee4 (diff) | |
download | linux-94bf91baf3a16ec274de3cd913be3033c029f853.tar.xz |
bnx2: Add missing memory barrier in bnx2_start_xmit()
Sync DMA descriptor before hitting the TX mailbox for weak memory model
CPUs.
There has been discussions several years ago about this. Some believe
that writel() should guarantee ordering. Others want explicit barriers
if necessary. Today writel() does not have the ordering guarantee and
many other drivers use explicit barriers.
Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 2ab31daef80f..7105989ba658 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -6565,6 +6565,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) } txbd->tx_bd_vlan_tag_flags |= TX_BD_FLAGS_END; + /* Sync BD data before updating TX mailbox */ + wmb(); + netdev_tx_sent_queue(txq, skb->len); prod = NEXT_TX_BD(prod); |