]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2: Add missing memory barrier in bnx2_start_xmit()
authorJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 06:00:24 +0000 (14:00 +0800)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 06:00:24 +0000 (14:00 +0800)
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 <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2.c

index e0b22cc3063e3913214148eb5bcf779c79561a90..230fff0d0366c63b1be95fda2949a42c78a46b25 100644 (file)
@@ -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;