]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ftgmac100: Move the barrier out of ftgmac100_txdes_set_dma_own()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 10 Apr 2017 01:15:22 +0000 (11:15 +1000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Apr 2017 20:03:57 +0000 (16:03 -0400)
We'll use variants of this accessor without barriers when
building series of descriptors for fragmented sends

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c

index add7462bf67df93127bbf8bcef1dd3629b39d10c..60f285e444f8ad6a8e3dd520b02d2b9486f118af 100644 (file)
@@ -485,11 +485,6 @@ static bool ftgmac100_txdes_owned_by_dma(struct ftgmac100_txdes *txdes)
 
 static void ftgmac100_txdes_set_dma_own(struct ftgmac100_txdes *txdes)
 {
-       /*
-        * Make sure dma own bit will not be set before any other
-        * descriptor fields.
-        */
-       wmb();
        txdes->txdes0 |= cpu_to_le32(FTGMAC100_TXDES0_TXDMA_OWN);
 }
 
@@ -679,6 +674,10 @@ static int ftgmac100_hard_start_xmit(struct sk_buff *skb,
                }
        }
 
+       /* Order the previous packet and descriptor udpates
+        * before setting the OWN bit.
+        */
+       dma_wmb();
        ftgmac100_txdes_set_dma_own(txdes);
 
        /* Update next TX pointer */