diff mbox series

[LEDE-DEV,5/5] ag71xx: remove dma_unmap_single as it is no-op.

Message ID 1512416424-629-5-git-send-email-rosenp@gmail.com
State Rejected
Headers show
Series [LEDE-DEV,1/5] ar71xx: Add QCA cache blasting patch | expand

Commit Message

Rosen Penev Dec. 4, 2017, 7:40 p.m. UTC
Qualcomm claims this is no-op for MIPS. Original commit message below:

From: Ben Menchaca <ben.menchaca@qca.qualcomm.com>
Date: Fri, 7 Jun 2013 11:19:08 -0500
Subject: [ag71xx] DMA unmap FROM_DEVICE no-op for our arch

The invalidate for FROM_DEVICE map/unmap pairs is done in the map.
The unmap is a no-op, but there is a cost for accessing that no-op
function through the large number of indirection layers presented
by the MIPS linux dma_ops.

Signed-off-by: Ben Menchaca <ben.menchaca@qca.qualcomm.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Felix Fietkau Dec. 4, 2017, 8:10 p.m. UTC | #1
On 2017-12-04 20:40, Rosen Penev wrote:
> Qualcomm claims this is no-op for MIPS. Original commit message below:
> 
> From: Ben Menchaca <ben.menchaca@qca.qualcomm.com>
> Date: Fri, 7 Jun 2013 11:19:08 -0500
> Subject: [ag71xx] DMA unmap FROM_DEVICE no-op for our arch
> 
> The invalidate for FROM_DEVICE map/unmap pairs is done in the map.
> The unmap is a no-op, but there is a cost for accessing that no-op
> function through the large number of indirection layers presented
> by the MIPS linux dma_ops.
> 
> Signed-off-by: Ben Menchaca <ben.menchaca@qca.qualcomm.com>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
NACK for this patch. It's true that dma-unmap is a no-op for most MIPS
devices, but I will take care of this in a generic way instead of
merging this driver specific hack.

- Felix
diff mbox series

Patch

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 566e951..b67e04e 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1051,8 +1051,14 @@  static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
 		pktlen = desc->ctrl & pktlen_mask;
 		pktlen -= ETH_FCS_LEN;
 
-		dma_unmap_single(&dev->dev, ring->buf[i].dma_addr,
-				 ag->rx_buf_size, DMA_FROM_DEVICE);
+		/*
+		 * This is where we'd unmap our buffer from the GMAC in a
+		 * general use of the DMA API.  On a MIPS platform this would
+		 * be a complete no-op so we don't bother:
+		 *
+		 * dma_unmap_single(&dev->dev, ring->buf[i].dma_addr,
+		 *		    ag->rx_buf_size, DMA_FROM_DEVICE);
+		 */
 
 		dev->stats.rx_packets++;
 		dev->stats.rx_bytes += pktlen;