ion: fix bugs in cma heap
authorColin Cross <ccross@android.com>
Sat, 14 Dec 2013 03:26:32 +0000 (19:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2013 16:59:54 +0000 (08:59 -0800)
commit661f82f6c219dc515ee5123213d8f57481694fe4
tree9e4d96bb2d12b0496bd5dff47f0bbf9026fe180d
parentdd608dd29a417da78f6aa1715efb9786787c550e
ion: fix bugs in cma heap

Implement ion_cma_unmap_kernel, ion will call it unconditionally.
Use correct gfp flags when calling dma_alloc_coherent so it doesn't
try to use atomic DMA memory.
Check for invalid alignment when allocating.
Reject cached allocations - the cpu address returned by
dma_alloc_coherent is always going to be an uncached mapping, so
map_kernel will not see data written by a cached userspace mapping.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_cma_heap.c