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:
[<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>
This commit is contained in:
Huang, Tao
2014-12-26 23:08:20 +08:00
parent ccddaafdb0
commit 679585fe2d

View File

@@ -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);