ion: rockchip: fix snapshot alignment fault on armv8
authorHuang, Tao <huangtao@rock-chips.com>
Tue, 23 Dec 2014 13:36:07 +0000 (21:36 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 23 Dec 2014 13:36:07 +0000 (21:36 +0800)
Fix this bug:
Unhandled fault: alignment fault (0x96000061) at 0xffffff8000006016
Internal error: : 96000061 [#1] PREEMPT SMP
Modules linked in: dc_fbdev(O) pvrsrvkm(O)
CPU: 0 PID: 125 Comm: Binder_2 Tainted: G           O 3.10.0 #36
task: ffffffc0530f7380 ti: ffffffc0531c0000 task.ti: ffffffc0531c0000
PC is at memcpy+0x2c/0x60
LR is at vsnprintf+0x100/0x598
[<ffffffc0002e093c>] memcpy+0x2c/0x60
[<ffffffc00018b3bc>] seq_vprintf+0x48/0x84
[<ffffffc00018b44c>] seq_printf+0x54/0x60
[<ffffffc00063a238>] ion_alloc+0x4fc/0x778
[<ffffffc00063a98c>] ion_ioctl+0x164/0x360
[<ffffffc00017bfa8>] vfs_ioctl+0x20/0x3c
[<ffffffc00017c8ac>] do_vfs_ioctl+0x474/0x540
[<ffffffc00017c9d4>] SyS_ioctl+0x5c/0x88

pgprot_noncached will map buffer as MT_DEVICE, but
All store accesses to Device memory use the asynchronous abort mechanism on
Cortex-A53.

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

index 4814b42cde0443f8180a84ef22152acbb4e9de4d..ea34e3ece796f8ddfca69e535c5195f18fdc22ac 100755 (executable)
@@ -112,7 +112,7 @@ static void * __init last_ion_vmap(phys_addr_t start, unsigned int page_count)
                pages[i] = pfn_to_page(addr >> PAGE_SHIFT);
        }
        pages[page_count] = pfn_to_page(start >> PAGE_SHIFT);
-       return vmap(pages, page_count + 1, VM_MAP, pgprot_noncached(PAGE_KERNEL));
+       return vmap(pages, page_count + 1, VM_MAP, pgprot_writecombine(PAGE_KERNEL));
 }
 
 static int __init rockchip_ion_snapshot_init(void)