ion: fix cma alloc bug
authorHuang, Tao <huangtao@rock-chips.com>
Fri, 26 Dec 2014 15:08:20 +0000 (23:08 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 26 Dec 2014 15:08:20 +0000 (23:08 +0800)
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:
[<ffffffc00008807c>] dump_backtrace+0x0/0x144
[<ffffffc0000881d0>] show_stack+0x10/0x1c
[<ffffffc000892838>] dump_stack+0x1c/0x28
[<ffffffc00088ffd0>] panic+0xe4/0x210
[<ffffffc00016673c>] new_slab+0x50/0x248
[<ffffffc000167b60>] __slab_alloc.isra.59.constprop.63+0x1f4/0x2d0
[<ffffffc000167cec>] __kmalloc+0xb0/0x1c4
[<ffffffc000092930>] __dma_alloc_noncoherent+0x7c/0x158
[<ffffffc000643cf0>] ion_cma_allocate+0xfc/0x27c
[<ffffffc0006404f8>] ion_alloc+0x134/0x778
[<ffffffc00064100c>] ion_ioctl+0x15c/0x344
[<ffffffc00017bfa8>] vfs_ioctl+0x20/0x3c
[<ffffffc00017c8ac>] do_vfs_ioctl+0x474/0x540
[<ffffffc00017c9d4>] SyS_ioctl+0x5c/0x88

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
drivers/staging/android/ion/ion_cma_heap.c

index 67a737fa39c29f042cdca94ad74fe77e3a98e89d..512f5688c06fdee373c8c374a536b72a2160bb52 100755 (executable)
@@ -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);