diff options
author | Rob Herring <rob.herring@calxeda.com> | 2013-08-30 17:49:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-03 22:21:15 -0400 |
commit | ca32723afedd65d612029705446bf44bde5eab14 (patch) | |
tree | ab65afe5d86f42a087990bce3b94f36470ac58b6 | |
parent | 1a1d4d2f30a3c7e91bb7876df95baae363be5434 (diff) |
net: calxedaxgmac: update ring buffer tx_head after barriers
Ensure that the descriptor writes are visible before the ring buffer head
is updated. Since writel is a barrier, we can simply update the head after
the writel.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/calxeda/xgmac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c index 64854ad84b55..f63085571241 100644 --- a/drivers/net/ethernet/calxeda/xgmac.c +++ b/drivers/net/ethernet/calxeda/xgmac.c | |||
@@ -1121,9 +1121,10 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1121 | wmb(); | 1121 | wmb(); |
1122 | desc_set_tx_owner(first, desc_flags | TXDESC_FIRST_SEG); | 1122 | desc_set_tx_owner(first, desc_flags | TXDESC_FIRST_SEG); |
1123 | 1123 | ||
1124 | writel(1, priv->base + XGMAC_DMA_TX_POLL); | ||
1125 | |||
1124 | priv->tx_head = dma_ring_incr(entry, DMA_TX_RING_SZ); | 1126 | priv->tx_head = dma_ring_incr(entry, DMA_TX_RING_SZ); |
1125 | 1127 | ||
1126 | writel(1, priv->base + XGMAC_DMA_TX_POLL); | ||
1127 | if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) < | 1128 | if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) < |
1128 | MAX_SKB_FRAGS) | 1129 | MAX_SKB_FRAGS) |
1129 | netif_stop_queue(dev); | 1130 | netif_stop_queue(dev); |