]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: fix the Rx desc buffer DMA unmapping
authorAntoine Tenart <antoine.tenart@bootlin.com>
Wed, 19 Sep 2018 13:29:06 +0000 (15:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Sep 2018 04:25:20 +0000 (21:25 -0700)
commitaed14afcb9b075cd40d1fd881605eb407313f278
tree6ddec638922cc14a0c2919a93eb018daacc7d95e
parenta4c49f991d44d36096ec09201274ab066958e851
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: 0db0df595cbd ("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>
drivers/net/ethernet/marvell/mvneta.c