Project

General

Profile

dma_free_coherent error in Kernel driver

Added by Julio Liriano about 10 years ago

I am having problems DE-allocating DMA memory space. Allocation works correctly with dma_alloc_coherent. I get the following
out of dmesg:
[ 4.345091] Virt Address : c095c000 Phys Address: 4095c000 Handle: 3e8c0000
This is after successfully allocating the dma space.

When I go to remove the driver however, I get an error. The "invalid coherent area" listed has
the same starting address as the virtual address shown when the allocation first took place.

modprobe r eds_prototype_driver
-----------
[ cut here ]------------
WARNING: CPU: 1 PID: 325 at arch/arm/mm/dma-mapping.c:296 _arm_dma_free.isra.15+0x184/0x194()
trying to free invalid coherent area: c095c000
Modules linked in: eds_prototype_driver(O-)
CPU: 1 PID: 325 Comm: modprobe Tainted: G O 3.12.0+ #2
[<800180bc>] (unwind_backtrace+0x0/0x100) from [<80012eb8>] (show_stack+0x20/0x24)
[<80012eb8>] (show_stack+0x20/0x24) from [<804bc490>] (dump_stack+0x88/0x98)
[<804bc490>] (dump_stack+0x88/0x98) from [<80024ae4>] (warn_slowpath_common+0x80/0x9c)
[<80024ae4>] (warn_slowpath_common+0x80/0x9c) from [<80024b40>] (warn_slowpath_fmt+0x40/0x48)
[<80024b40>] (warn_slowpath_fmt+0x40/0x48) from [<8001c900>] (
_arm_dma_free.isra.15+0x184/0x194)
[<8001c900>] (_arm_dma_free.isra.15+0x184/0x194) from [<8001c960>] (arm_dma_free+0x24/0x2c)
[<8001c960>] (arm_dma_free+0x24/0x2c) from [<7f0006d4>] (removeScanGenCharDev+0xd0/0x108 [eds_prototype_driver])
[<7f0006d4>] (removeScanGenCharDev+0xd0/0x108 [eds_prototype_driver]) from [<8007e7e0>] (SyS_delete_module+0x134/0x220)
[<8007e7e0>] (SyS_delete_module+0x134/0x220) from [<8000e960>] (ret_fast_syscall+0x0/0x30)
---[ end trace d0c204bdd38cc67d ]---
BUG: Bad page state in process udevd pfn:3e8df
page:80f45be0 count:-1 mapcount:0 mapping: (null) index:0x0
page flags: 0x0(root@WonderWoman:~# )
Modules linked in: [last unloaded: eds_prototype_driver]
CPU: 1 PID: 236 Comm: udevd Tainted: G W O 3.12.0+ #2
[<800180bc>] (unwind_backtrace+0x0/0x100) from [<80012eb8>] (show_stack+0x20/0x24)
[<80012eb8>] (show_stack+0x20/0x24) from [<804bc490>] (dump_stack+0x88/0x98)
[<804bc490>] (dump_stack+0x88/0x98) from [<800c31cc>] (bad_page+0xd0/0x120)
[<800c31cc>] (bad_page+0xd0/0x120) from [<800c38b4>] (get_page_from_freelist+0x578/0x670)
[<800c38b4>] (get_page_from_freelist+0x578/0x670) from [<800c4388>] (
_alloc_pages_nodemask+0x154/0x8e4)
[<800c4388>] (_alloc_pages_nodemask+0x154/0x8e4) from [<800c4b38>] (_get_free_pages+0x20/0x5c)
[<800c4b38>] (__get_free_pages+0x20/0x5c) from [<800e49f0>] (unmap_region+0x80/0x184)
[<800e49f0>] (unmap_region+0x80/0x184) from [<800e6714>] (do_munmap+0x1f8/0x32c)
[<800e6714>] (do_munmap+0x1f8/0x32c) from [<800e6894>] (vm_munmap+0x4c/0x60)
[<800e6894>] (vm_munmap+0x4c/0x60) from [<800e76e4>] (SyS_munmap+0x2c/0x30)
[<800e76e4>] (SyS_munmap+0x2c/0x30) from [<8000e960>] (ret_fast_syscall+0x0/0x30)
Disabling lock debugging due to kernel taint

What could be the problem?


Go to top
Add picture from clipboard (Maximum size: 1 GB)