summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/fec_main.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-11 10:35:58 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-17 14:35:10 +0100
commita29dc07047c66ae31354b3953e136356b2f92cf5 (patch)
tree7f0949de8ad6ac0bd2168b3ebfdd14ce24ed146c /drivers/net/ethernet/freescale/fec_main.c
parent0fcc609a72a757088042d8557812986f6e4621a4 (diff)
net: fec: add barrier to transmit path to ensure proper ordering
Ensure that the writes to the descriptor data is visible to the hardware before the descriptor is handed over to the hardware. Having discussed this with Will Deacon, we need a wmb() between writing the descriptor data and handing the descriptor over to the hardware. The corresponding rmb() is in the ethernet hardware. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 85841fb1dfda..5c75217169f8 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -581,6 +581,13 @@ static int fec_enet_txq_submit_skb(struct sk_buff *skb, struct net_device *ndev)
bdp->cbd_datlen = buflen;
bdp->cbd_bufaddr = addr;
+ /*
+ * We need the preceding stores to the descriptor to complete
+ * before updating the status field, which hands it over to the
+ * hardware. The corresponding rmb() is "in the hardware".
+ */
+ wmb();
+
/* Send it on its way. Tell FEC it's ready, interrupt when done,
* it's the last BD of the frame, and to put the CRC on the end.
*/