Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Chan and committed by
David S. Miller
6541b806 c441b456

+9
+9
drivers/net/ethernet/broadcom/tg3.c
··· 5928 5928 5929 5929 /* Refill RX ring(s). */ 5930 5930 if (!tg3_flag(tp, ENABLE_RSS)) { 5931 + /* Sync BD data before updating mailbox */ 5932 + wmb(); 5933 + 5931 5934 if (work_mask & RXD_OPAQUE_RING_STD) { 5932 5935 tpr->rx_std_prod_idx = std_prod_idx & 5933 5936 tp->rx_std_ring_mask; ··· 6972 6969 6973 6970 skb_tx_timestamp(skb); 6974 6971 netdev_sent_queue(tp->dev, skb->len); 6972 + 6973 + /* Sync BD data before updating mailbox */ 6974 + wmb(); 6975 6975 6976 6976 /* Packets are ready, update Tx producer idx local and on card. */ 6977 6977 tw32_tx_mbox(tnapi->prodmbox, entry); ··· 11768 11762 } 11769 11763 11770 11764 tnapi->tx_prod++; 11765 + 11766 + /* Sync BD data before updating mailbox */ 11767 + wmb(); 11771 11768 11772 11769 tw32_tx_mbox(tnapi->prodmbox, tnapi->tx_prod); 11773 11770 tr32_mailbox(tnapi->prodmbox);