net: nemac: Fix dma check map error when enable DMA_API_DEBUG
The kernel prints some warnings as below when compiled with CONFIG_DMA_API_DEBUG.
This is because the nemac driver doesn't check the return value of pci_map_single().
[ 57.381287] WARNING: CPU: 0 PID: 0 at kernel-source/lib/dma-debug.c:1156 check_unmap+0x478/0x978()
[ 57.381293] axxia-nemac 8080240000.ethernet: DMA-API: device driver failed to check map error[device address=0x00000003e4cf9002] [size=90 bytes] [mapped as single]
[ 57.381296] Modules linked in:
[ 57.381300] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.21-WR8.0.0.0_standard #44
[ 57.381302] Hardware name: AXM56xx Victoria (DT)
[ 57.381304] Call trace:
[ 57.381311] [<ffffffc00008ace0>] dump_backtrace+0x0/0x150
[ 57.381315] [<ffffffc00008ae54>] show_stack+0x24/0x30
[ 57.381321] [<ffffffc000aacf0c>] dump_stack+0xa8/0xe0
[ 57.381325] [<ffffffc00009ed8c>] warn_slowpath_common+0xa4/0xe0
[ 57.381328] [<ffffffc00009ee2c>] warn_slowpath_fmt+0x64/0x78
[ 57.381331] [<ffffffc0006235c8>] check_unmap+0x478/0x978
[ 57.381333] [<ffffffc000623b30>] debug_dma_unmap_page+0x68/0x70
[ 57.381339] [<ffffffc0007bc978>] nemac_poll+0x338/0x528
[ 57.381344] [<ffffffc000948aa4>] net_rx_action+0x27c/0x5d0
[ 57.381348] [<ffffffc0000a4d50>] __do_softirq+0x488/0x8b8
[ 57.381351] [<ffffffc0000a550c>] irq_exit+0xac/0xe0
[ 57.381355] [<ffffffc000111948>] __handle_domain_irq+0x90/0x100
[ 57.381358] [<ffffffc000082560>] gic_handle_irq+0x88/0xe8
[ 57.381361] Exception stack(0xffffffc0011a3d80 to 0xffffffc0011a3ea0)
[ 57.381366] 3d80: 011a0000 ffffffc0 012a6000 ffffffc0 011a3ed0 ffffffc0 00086a1c ffffffc0
......
[ 57.381391] 3e80: 00000000 00000000 01194aa0 ffffffc0 011a3ee0 ffffffc0 011a3ed0 ffffffc0
[ 57.381394] [<ffffffc0000835ac>] el1_irq+0x6c/0xe0
[ 57.381399] [<ffffffc0000f1558>] cpu_idle_loop+0x480/0x5f0
[ 57.381402] [<ffffffc0000f16e0>] cpupri_find+0x0/0x150
[ 57.381405] [<ffffffc000aa5f08>] rest_init+0x158/0x168
[ 57.381410] [<ffffffc000e6e9e8>] start_kernel+0x3fc/0x410
[ 57.381412] ---[ end trace 2084b171030e6142 ]---
[ 57.381413] Mapped at:
[ 57.381418] [<ffffffc000621fc8>] dma_entry_alloc+0x68/0xa8
[ 57.381423] [<ffffffc000624204>] debug_dma_map_page+0x9c/0x140
[ 57.381427] [<ffffffc0007bcce8>] nemac_xmit+0x180/0x370
[ 57.381432] [<ffffffc00094975c>] xmit_one.isra.25.constprop.41+0x2ec/0x938
[ 57.381436] [<ffffffc00094ab40>] dev_hard_start_xmit+0x60/0xe8
Signed-off-by:
Quanyang Wang <quanyang.wang@windriver.com>
Loading