remarkable-linux/arch/arm/mm
Aaro Koskinen d9e0d149b5 ARM: dma-mapping: fix incorrect freeing of atomic allocations
Commit e9da6e9905 (ARM: dma-mapping:
remove custom consistent dma region) changed the way atomic allocations
are handled. However, arm_dma_free() was not modified accordingly, and
as a result freeing of atomic allocations does not work correctly when
CMA is disabled. Memory is leaked and following WARNINGs are seen:

[   57.698911] ------------[ cut here ]------------
[   57.753518] WARNING: at arch/arm/mm/dma-mapping.c:263 arm_dma_free+0x88/0xe4()
[   57.811473] trying to free invalid coherent area: e0848000
[   57.867398] Modules linked in: sata_mv(-)
[   57.921373] [<c000d270>] (unwind_backtrace+0x0/0xf0) from [<c0015430>] (warn_slowpath_common+0x50/0x68)
[   58.033924] [<c0015430>] (warn_slowpath_common+0x50/0x68) from [<c00154dc>] (warn_slowpath_fmt+0x30/0x40)
[   58.152024] [<c00154dc>] (warn_slowpath_fmt+0x30/0x40) from [<c000dc18>] (arm_dma_free+0x88/0xe4)
[   58.219592] [<c000dc18>] (arm_dma_free+0x88/0xe4) from [<c008fa30>] (dma_pool_destroy+0x100/0x148)
[   58.345526] [<c008fa30>] (dma_pool_destroy+0x100/0x148) from [<c019a64c>] (release_nodes+0x144/0x218)
[   58.475782] [<c019a64c>] (release_nodes+0x144/0x218) from [<c0197e10>] (__device_release_driver+0x60/0xb8)
[   58.614260] [<c0197e10>] (__device_release_driver+0x60/0xb8) from [<c0198608>] (driver_detach+0xd8/0xec)
[   58.756527] [<c0198608>] (driver_detach+0xd8/0xec) from [<c0197c54>] (bus_remove_driver+0x7c/0xc4)
[   58.901648] [<c0197c54>] (bus_remove_driver+0x7c/0xc4) from [<c004bfac>] (sys_delete_module+0x19c/0x220)
[   59.051447] [<c004bfac>] (sys_delete_module+0x19c/0x220) from [<c0009140>] (ret_fast_syscall+0x0/0x2c)
[   59.207996] ---[ end trace 0745420412c0325a ]---
[   59.287110] ------------[ cut here ]------------
[   59.366324] WARNING: at arch/arm/mm/dma-mapping.c:263 arm_dma_free+0x88/0xe4()
[   59.450511] trying to free invalid coherent area: e0847000
[   59.534357] Modules linked in: sata_mv(-)
[   59.616785] [<c000d270>] (unwind_backtrace+0x0/0xf0) from [<c0015430>] (warn_slowpath_common+0x50/0x68)
[   59.790030] [<c0015430>] (warn_slowpath_common+0x50/0x68) from [<c00154dc>] (warn_slowpath_fmt+0x30/0x40)
[   59.972322] [<c00154dc>] (warn_slowpath_fmt+0x30/0x40) from [<c000dc18>] (arm_dma_free+0x88/0xe4)
[   60.070701] [<c000dc18>] (arm_dma_free+0x88/0xe4) from [<c008fa30>] (dma_pool_destroy+0x100/0x148)
[   60.256817] [<c008fa30>] (dma_pool_destroy+0x100/0x148) from [<c019a64c>] (release_nodes+0x144/0x218)
[   60.445201] [<c019a64c>] (release_nodes+0x144/0x218) from [<c0197e10>] (__device_release_driver+0x60/0xb8)
[   60.634148] [<c0197e10>] (__device_release_driver+0x60/0xb8) from [<c0198608>] (driver_detach+0xd8/0xec)
[   60.823623] [<c0198608>] (driver_detach+0xd8/0xec) from [<c0197c54>] (bus_remove_driver+0x7c/0xc4)
[   61.013268] [<c0197c54>] (bus_remove_driver+0x7c/0xc4) from [<c004bfac>] (sys_delete_module+0x19c/0x220)
[   61.203472] [<c004bfac>] (sys_delete_module+0x19c/0x220) from [<c0009140>] (ret_fast_syscall+0x0/0x2c)
[   61.393390] ---[ end trace 0745420412c0325b ]---

The patch fixes this.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2012-08-09 07:46:07 +02:00
..
abort-ev4.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
abort-ev4t.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
abort-ev5t.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
abort-ev5tj.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
abort-ev6.S ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores 2012-04-23 14:21:52 +01:00
abort-ev7.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
abort-lv4t.S ARM: entry: data abort: ensure r5 is preserved by abort functions 2011-07-02 10:56:12 +01:00
abort-macro.S ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort 2011-09-10 23:39:56 +01:00
abort-nommu.S ARM: entry: data abort: tail-call the main data abort handler 2011-07-02 10:56:11 +01:00
alignment.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
cache-fa.S ARM: mm: cache-fa: Use the new processor struct macros 2011-07-07 15:31:05 +01:00
cache-feroceon-l2.c ARM: move CP15 definitions to separate header file 2012-03-28 18:30:01 +01:00
cache-l2x0.c ARM: 7398/1: l2x0: only write to debug registers on PL310 2012-04-23 14:21:52 +01:00
cache-tauros2.c ARM: cache: tauros2: add disable and resume callback 2012-05-07 11:43:48 +08:00
cache-v3.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-v4.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-v4wb.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-v4wt.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-v6.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-v7.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
cache-xsc3l2.c ARM: move CP15 definitions to separate header file 2012-03-28 18:30:01 +01:00
context.c ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process 2012-07-09 17:41:10 +01:00
copypage-fa.c arm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:14 +08:00
copypage-feroceon.c arm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:14 +08:00
copypage-v4mc.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
copypage-v4wb.c arm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:14 +08:00
copypage-v4wt.c arm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:14 +08:00
copypage-v6.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
copypage-xsc3.c arm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:14 +08:00
copypage-xscale.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
dma-mapping.c ARM: dma-mapping: fix incorrect freeing of atomic allocations 2012-08-09 07:46:07 +02:00
extable.c [ARM] Convert asm/uaccess.h to linux/uaccess.h 2008-09-06 11:35:55 +01:00
fault-armv.c arm: remove several unnecessary module.h include instances 2011-10-31 19:30:48 -04:00
fault.c Merge branch 'v3-removal' into for-linus 2012-05-21 15:15:33 +01:00
fault.h ARM: LPAE: Add fault handling support 2011-12-08 10:30:40 +00:00
flush.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
fsr-2level.c ARM: LPAE: Move the FSR definitions to separate files 2011-12-08 10:30:37 +00:00
fsr-3level.c ARM: LPAE: Add fault handling support 2011-12-08 10:30:40 +00:00
highmem.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
idmap.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
init.c Merge branches 'audit', 'delay', 'fixes', 'misc' and 'sta2x11' into for-linus 2012-07-27 23:06:32 +01:00
iomap.c arm/PCI: remove arch pci_flags definition 2012-02-23 20:18:56 -07:00
ioremap.c ARM: 7432/1: use the new linux/sizes.h 2012-06-28 17:14:35 +01:00
Kconfig ARM: Remove support for ARMv3 ARM610 and ARM710 CPUs 2012-05-05 05:50:50 +01:00
Makefile ARM: Remove support for ARMv3 ARM610 and ARM710 CPUs 2012-05-05 05:50:50 +01:00
mm.h ARM: dma-mapping: remove custom consistent dma region 2012-07-30 12:25:45 +02:00
mmap.c ARM: 7169/1: topdown mmap support 2011-12-06 11:15:25 +00:00
mmu.c Merge branches 'audit', 'delay', 'fixes', 'misc' and 'sta2x11' into for-linus 2012-07-27 23:06:32 +01:00
nommu.c ARM: 7383/1: nommu: populate vectors page from paging_init 2012-04-13 14:05:42 +01:00
pabort-legacy.S ARM: entry: prefetch abort: tail-call the main prefetch abort handler 2011-07-02 10:56:10 +01:00
pabort-v6.S ARM: entry: prefetch abort: tail-call the main prefetch abort handler 2011-07-02 10:56:10 +01:00
pabort-v7.S ARM: entry: prefetch abort: tail-call the main prefetch abort handler 2011-07-02 10:56:10 +01:00
pgd.c ARM: move CP15 definitions to separate header file 2012-03-28 18:30:01 +01:00
proc-arm7tdmi.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-arm9tdmi.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-arm720.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-arm740.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-arm920.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm922.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm925.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm926.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm940.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm946.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm1020.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm1020e.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm1022.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-arm1026.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-fa526.S Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
proc-feroceon.S ARM: 7408/1: cacheflush: return error to userspace when flushing syscall fails 2012-05-02 11:12:49 +01:00
proc-macros.S ARM: LPAE: MMU setup for the 3-level page table format 2011-12-08 10:30:39 +00:00
proc-mohawk.S arm-soc: power management changes 2012-05-22 09:41:01 -07:00
proc-sa110.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-sa1100.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-syms.c ARM: add size argument to __cpuc_flush_dcache_page 2009-12-14 14:53:22 +00:00
proc-v6.S ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process 2012-07-09 17:41:10 +01:00
proc-v7-2level.S ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process 2012-07-09 17:41:10 +01:00
proc-v7-3level.S ARM: LPAE: MMU setup for the 3-level page table format 2011-12-08 10:30:39 +00:00
proc-v7.S ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE 2012-04-15 22:00:31 +01:00
proc-xsc3.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
proc-xscale.S ARM: proc-*.S: place cpu_reset functions into .idmap.text section 2011-12-06 14:04:14 +00:00
tlb-fa.S Merge branch 'devel-stable' into for-next 2011-07-22 23:09:07 +01:00
tlb-v4.S ARM: mm: tlb-v4: Use the new processor struct macros 2011-07-07 15:31:12 +01:00
tlb-v4wb.S ARM: mm: tlb-v4wb: Use the new processor struct macros 2011-07-07 15:31:12 +01:00
tlb-v4wbi.S ARM: mm: tlb-v4wbi: Use the new processor struct macros 2011-07-07 15:31:12 +01:00
tlb-v6.S Merge branch 'devel-stable' into for-next 2011-07-22 23:09:07 +01:00
tlb-v7.S ARM: 7478/1: errata: extend workaround for erratum #720789 2012-07-31 10:30:43 +01:00
vmregion.c ARM: add dma coherent region reporting via procfs 2012-01-23 10:23:57 +00:00
vmregion.h ARM: dma-mapping: add support for IOMMU mapper 2012-05-21 15:06:23 +02:00