]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net: fec: unmap the xmit buffer that are not transferred by DMA
authorFugang Duan <fugang.duan@nxp.com>
Fri, 22 Dec 2017 09:12:09 +0000 (17:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Dec 2017 15:55:55 +0000 (10:55 -0500)
commit178e5f57a8d8f8fc5799a624b96fc31ef9a29ffa
tree3dabce54cb49a208d995d9340d38d762dabd5a7f
parent642a8439ddd8423b92f2e71960afe21ee1f66bb6
net: fec: unmap the xmit buffer that are not transferred by DMA

The enet IP only support 32 bit, it will use swiotlb buffer to do dma
mapping when xmit buffer DMA memory address is bigger than 4G in i.MX
platform. After stress suspend/resume test, it will print out:

log:
[12826.352864] fec 5b040000.ethernet: swiotlb buffer is full (sz: 191 bytes)
[12826.359676] DMA: Out of SW-IOMMU space for 191 bytes at device 5b040000.ethernet
[12826.367110] fec 5b040000.ethernet eth0: Tx DMA memory map failed

The issue is that the ready xmit buffers that are dma mapped but DMA still
don't copy them into fifo, once MAC restart, these DMA buffers are not unmapped.
So it should check the dma mapping buffer and unmap them.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c