Commit f32bfb9a authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

sh_eth: use DMA barriers

Commit  7d7355f5 ("sh_eth: Ensure proper ordering of descriptor active
bit write/read") did the right thing  but used too "heavy" barriers while
there were already "lighter" DMA barriers exactly  for this case...
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73186df8
...@@ -1416,7 +1416,7 @@ static int sh_eth_txfree(struct net_device *ndev) ...@@ -1416,7 +1416,7 @@ static int sh_eth_txfree(struct net_device *ndev)
if (txdesc->status & cpu_to_edmac(mdp, TD_TACT)) if (txdesc->status & cpu_to_edmac(mdp, TD_TACT))
break; break;
/* TACT bit must be checked before all the following reads */ /* TACT bit must be checked before all the following reads */
rmb(); dma_rmb();
netif_info(mdp, tx_done, ndev, netif_info(mdp, tx_done, ndev,
"tx entry %d status 0x%08x\n", "tx entry %d status 0x%08x\n",
entry, edmac_to_cpu(mdp, txdesc->status)); entry, edmac_to_cpu(mdp, txdesc->status));
...@@ -1458,7 +1458,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) ...@@ -1458,7 +1458,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
rxdesc = &mdp->rx_ring[entry]; rxdesc = &mdp->rx_ring[entry];
while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) { while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) {
/* RACT bit must be checked before all the following reads */ /* RACT bit must be checked before all the following reads */
rmb(); dma_rmb();
desc_status = edmac_to_cpu(mdp, rxdesc->status); desc_status = edmac_to_cpu(mdp, rxdesc->status);
pkt_len = rxdesc->frame_length; pkt_len = rxdesc->frame_length;
...@@ -1544,7 +1544,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) ...@@ -1544,7 +1544,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
rxdesc->addr = dma_addr; rxdesc->addr = dma_addr;
} }
wmb(); /* RACT bit must be set after all the above writes */ dma_wmb(); /* RACT bit must be set after all the above writes */
if (entry >= mdp->num_rx_ring - 1) if (entry >= mdp->num_rx_ring - 1)
rxdesc->status |= rxdesc->status |=
cpu_to_edmac(mdp, RD_RACT | RD_RFP | RD_RDLE); cpu_to_edmac(mdp, RD_RACT | RD_RFP | RD_RDLE);
...@@ -2403,7 +2403,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -2403,7 +2403,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
} }
txdesc->buffer_length = skb->len; txdesc->buffer_length = skb->len;
wmb(); /* TACT bit must be set after all the above writes */ dma_wmb(); /* TACT bit must be set after all the above writes */
if (entry >= mdp->num_tx_ring - 1) if (entry >= mdp->num_tx_ring - 1)
txdesc->status |= cpu_to_edmac(mdp, TD_TACT | TD_TDLE); txdesc->status |= cpu_to_edmac(mdp, TD_TACT | TD_TDLE);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment