ion: fix bugs in cma heap
authorColin Cross <ccross@android.com>
Wed, 27 Nov 2013 23:53:21 +0000 (15:53 -0800)
committerColin Cross <ccross@android.com>
Thu, 12 Dec 2013 23:27:15 +0000 (15:27 -0800)
commit8069739d23200f68b59570f6c4c5a8ec66f38fab
treea0e023d270b9e11f1affe1e833e7ea3c83db7156
parent1b1cbed2f4cd92b9ccfd28b985983e2d217ecd2e
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.

Change-Id: I2ea03f28fae3749f6de0b89700b69da3845926ea
Signed-off-by: Colin Cross <ccross@android.com>
drivers/staging/android/ion/ion_cma_heap.c