From: Huang, Tao Date: Fri, 26 Dec 2014 15:08:20 +0000 (+0800) Subject: ion: fix cma alloc bug X-Git-Tag: firefly_0821_release~4158^2~476 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=679585fe2da9fde2b5e339a2c9886b45208b02b7;p=firefly-linux-kernel-4.4.55.git ion: fix cma alloc bug Fix this bug on ARM64: BUG: failure at mm/slub.c:1351/new_slab()! Kernel panic - not syncing: BUG! CPU: 0 PID: 1596 Comm: Binder_5 Tainted: G O 3.10.0 #45 Call trace: [] dump_backtrace+0x0/0x144 [] show_stack+0x10/0x1c [] dump_stack+0x1c/0x28 [] panic+0xe4/0x210 [] new_slab+0x50/0x248 [] __slab_alloc.isra.59.constprop.63+0x1f4/0x2d0 [] __kmalloc+0xb0/0x1c4 [] __dma_alloc_noncoherent+0x7c/0x158 [] ion_cma_allocate+0xfc/0x27c [] ion_alloc+0x134/0x778 [] ion_ioctl+0x15c/0x344 [] vfs_ioctl+0x20/0x3c [] do_vfs_ioctl+0x474/0x540 [] SyS_ioctl+0x5c/0x88 Signed-off-by: Huang, Tao --- diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index 67a737fa39c2..512f5688c06f 100755 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -88,7 +88,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, } info->cpu_addr = dma_alloc_attrs(dev, len, &(info->handle), - GFP_HIGHUSER | __GFP_ZERO, &attrs); + GFP_USER | __GFP_ZERO, &attrs); if (!info->cpu_addr) { dev_err(dev, "Fail to allocate(%lx) buffer\n", len);