summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-03-04 14:48:14 +0000
committerDavid S. Miller <davem@davemloft.net>2012-03-04 20:39:31 -0500
commit6541b806b5f267eda8f127bb7f5fec4e7e4db995 (patch)
tree2415db513402df4b8c6a5f027a9045a80893b982 /drivers/net/ethernet/broadcom
parentc441b456767357322dbc14b55bdc7da0051d0d98 (diff)
downloadblackbird-op-linux-6541b806b5f267eda8f127bb7f5fec4e7e4db995.tar.gz
blackbird-op-linux-6541b806b5f267eda8f127bb7f5fec4e7e4db995.zip
tg3: Add memory barriers to sync BD data
for weak memory model architectures to ensure that the chip will DMA valid BD data. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 4b3243b2bdf1..0da93dbbd0c8 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -5928,6 +5928,9 @@ next_pkt_nopost:
/* Refill RX ring(s). */
if (!tg3_flag(tp, ENABLE_RSS)) {
+ /* Sync BD data before updating mailbox */
+ wmb();
+
if (work_mask & RXD_OPAQUE_RING_STD) {
tpr->rx_std_prod_idx = std_prod_idx &
tp->rx_std_ring_mask;
@@ -6970,6 +6973,9 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_tx_timestamp(skb);
netdev_sent_queue(tp->dev, skb->len);
+ /* Sync BD data before updating mailbox */
+ wmb();
+
/* Packets are ready, update Tx producer idx local and on card. */
tw32_tx_mbox(tnapi->prodmbox, entry);
@@ -11763,6 +11769,9 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, bool tso_loopback)
tnapi->tx_prod++;
+ /* Sync BD data before updating mailbox */
+ wmb();
+
tw32_tx_mbox(tnapi->prodmbox, tnapi->tx_prod);
tr32_mailbox(tnapi->prodmbox);
OpenPOWER on IntegriCloud