Skip to content

Commit cf5cca6

Browse files
atenartdavem330
authored andcommitted
net: mvneta: fix the Rx desc buffer DMA unmapping
With CONFIG_DMA_API_DEBUG enabled we now get a warning when using the mvneta driver: mvneta d0030000.ethernet: DMA-API: device driver frees DMA memory with wrong function [device address=0x000000001165b000] [size=4096 bytes] [mapped as page] [unmapped as single] This is because when using the s/w buffer management, the Rx descriptor buffer is mapped with dma_map_page but unmapped with dma_unmap_single. This patch fixes this by using the right unmapping function. Fixes: 562e2f4 ("net: mvneta: Improve the buffer allocation method for SWBM") Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 76c0ddd commit cf5cca6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,8 +2008,8 @@ static int mvneta_rx_swbm(struct napi_struct *napi,
20082008
skb_add_rx_frag(rxq->skb, frag_num, page,
20092009
frag_offset, frag_size,
20102010
PAGE_SIZE);
2011-
dma_unmap_single(dev->dev.parent, phys_addr,
2012-
PAGE_SIZE, DMA_FROM_DEVICE);
2011+
dma_unmap_page(dev->dev.parent, phys_addr,
2012+
PAGE_SIZE, DMA_FROM_DEVICE);
20132013
rxq->left_size -= frag_size;
20142014
}
20152015
} else {

0 commit comments

Comments
 (0)