From: Joe Jin Date: Wed, 16 May 2012 06:00:24 +0000 (+0800) Subject: bnx2: Add missing memory barrier in bnx2_start_xmit() X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~636 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=84911f593a6509aae18820839bf2413441d1b593;p=users%2Fjedix%2Flinux-maple.git 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. (backported from commit 94bf91baf3a16ec274de3cd913be3033c029f853) Signed-off-by: Vlad Zolotarov Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index e0b22cc3063e..230fff0d0366 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -6559,6 +6559,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(); + prod = NEXT_TX_BD(prod); txr->tx_prod_bseq += skb->len;