]> git.baikalelectronics.ru Git - kernel.git/commit
sh_eth: unmap DMA buffers when freeing rings
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Mon, 17 Apr 2017 12:55:22 +0000 (15:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Apr 2017 02:04:32 +0000 (22:04 -0400)
commit2b7d514c4db0f756c825b3610772c7330e608359
tree08420b64ac5becc6dcd37ffe41b2275b732957e0
parent98465176d4e18eb816030672619609cc29a1da8c
sh_eth: unmap DMA buffers when freeing rings

The DMA API debugging (when enabled) causes:

WARNING: CPU: 0 PID: 1445 at lib/dma-debug.c:519 add_dma_entry+0xe0/0x12c
DMA-API: exceeded 7 overlapping mappings of cacheline 0x01b2974d

to be  printed after repeated initialization of the Ether device, e.g.
suspend/resume or 'ifconfig' up/down. This is because DMA buffers mapped
using dma_map_single() in sh_eth_ring_format() and sh_eth_start_xmit() are
never unmapped. Resolve this problem by unmapping the buffers when freeing
the descriptor  rings;  in order  to do it right, we'd have to add an extra
parameter to sh_eth_txfree() (we rename this function to sh_eth_tx_free(),
while at it).

Based on the commit 4398b8db91f1 ("ravb: unmap descriptors when freeing
rings").

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c