iMX6Q: DMA-API: device driver tries to free DMA memory it has not allocated

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX6Q: DMA-API: device driver tries to free DMA memory it has not allocated

654 Views
Tarek
Senior Contributor I

Hello,


I have enabled DMA-API debugging in kernel and there is a suspicious error message at boot time:

------------[ cut here ]------------

WARNING: at lib/dma-debug.c:811 check_unmap+0x64c/0x6fc()

net eth0: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x000000004fafd020] [size=2048 bytes]

Modules linked in:

[<800477f4>] (unwind_backtrace+0x0/0xf8) from [<80073f40>] (warn_slowpath_common+0x4c/0x64)

[<80073f40>] (warn_slowpath_common+0x4c/0x64) from [<80073fec>] (warn_slowpath_fmt+0x30/0x40)

[<80073fec>] (warn_slowpath_fmt+0x30/0x40) from [<802466b8>] (check_unmap+0x64c/0x6fc)

[<802466b8>] (check_unmap+0x64c/0x6fc) from [<80246978>] (debug_dma_unmap_page+0x6c/0x78)

[<80246978>] (debug_dma_unmap_page+0x6c/0x78) from [<80307180>] (fec_rx_poll+0x274/0x320)

[<80307180>] (fec_rx_poll+0x274/0x320) from [<80431838>] (net_rx_action+0xb0/0x17c)

[<80431838>] (net_rx_action+0xb0/0x17c) from [<80079858>] (__do_softirq+0xac/0x140)

[<80079858>] (__do_softirq+0xac/0x140) from [<80079d94>] (irq_exit+0x94/0x9c)

[<80079d94>] (irq_exit+0x94/0x9c) from [<80041834>] (handle_IRQ+0x50/0xac)

[<80041834>] (handle_IRQ+0x50/0xac) from [<800409cc>] (__irq_svc+0x4c/0xe8)

[<800409cc>] (__irq_svc+0x4c/0xe8) from [<80041ac4>] (default_idle+0x24/0x28)

[<80041ac4>] (default_idle+0x24/0x28) from [<80041cbc>] (cpu_idle+0xbc/0xfc)

[<80041cbc>] (cpu_idle+0xbc/0xfc) from [<80008868>] (start_kernel+0x248/0x288)

[<80008868>] (start_kernel+0x248/0x288) from [<10008040>] (0x10008040)

---[ end trace eb6dbc58214043bd ]---

What is the source of this error?

Labels (2)
0 Kudos
3 Replies

91 Views
lily_zhang
NXP Employee
NXP Employee

This warning comes from fec_rx_poll function in drivers/net/fec.c.

            if (bdp->cbd_bufaddr)
                    dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr,
                            FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);


We will check and fix it if possible.


0 Kudos

91 Views
DuanFugang
NXP Employee
NXP Employee

The issue is brought from kernel upgrade, it must be:

          dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr, FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);

All dev is pdev->dev, not pdev->dev.parent

Thanks,

Andy

0 Kudos

91 Views
Tarek
Senior Contributor I

Thanks Andy for the info.

Can you please let us know what does this bug affects and is it essential to make that change?

Thanks,

Tarek

0 Kudos