[PATCH 3/4] net: mvneta: Remove unnecessary DMA ops

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Thu Apr 9 18:01:53 PDT 2015


Commit a76c62f80d95860e6c5904ab5cb91667c43f61eb
 ("net: mvneta: convert to streaming DMA ops")
converted explicit ARM cache flushes to streaming DMA calls.

However, in mvneta_send() we are not interested in the sent data buffer
anymore. Also, in mvneta_recv() the device does not care about received
data buffer.

Remove unnecessary dma_sync_single_for_cpu() in mvneta_send() and
dma_sync_single_for_device() in mvneta_recv().

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
Cc: barebox at lists.infradead.org
Cc: Lucas Stach <dev at lynxeye.de>
Cc: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 drivers/net/mvneta.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 3be2ec531fb1..e1c7f15210e4 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -409,7 +409,6 @@ static int mvneta_send(struct eth_device *edev, void *data, int len)
 	 * the Tx port status register (PTXS).
 	 */
 	ret = wait_on_timeout(TRANSFER_TIMEOUT, !mvneta_pending_tx(priv));
-	dma_sync_single_for_cpu((unsigned long)data, len, DMA_TO_DEVICE);
 	if (ret) {
 		dev_err(&edev->dev, "transmit timeout\n");
 		return ret;
@@ -468,9 +467,6 @@ static int mvneta_recv(struct eth_device *edev)
 			  rxdesc->data_size - MVNETA_MH_SIZE);
 	ret = 0;
 
-	dma_sync_single_for_device((unsigned long)rxdesc->buf_phys_addr,
-				   ALIGN(PKTSIZE, 8), DMA_FROM_DEVICE);
-
 recv_err:
 	/* reset this and get next rx descriptor*/
 	rxdesc->data_size = 0;
-- 
2.1.0




More information about the barebox mailing list