Commit a26a60fc authored by Zhang Jiejing's avatar Zhang Jiejing Committed by Terry Lv

ENGR00216013-2 mx6: not call memblock_free after reserve memory.

Remove call memblock_free after reserve memory with memblock_allocate().
The function of memblock_free is to remove the memory block from reserve list
of memblock, it will totally lost the info about how much phy memory
we have.

Skipping call this can make the reserved memory be accountable in
memblock With no side-effect.

After doing this, we can know how much our phy memory is, then can add check
in our driver like(vpu) to check the phy memory valid or not before vpu start
use the address.
Signed-off-by: default avatarZhang Jiejing <jiejing.zhang@freescale.com>
parent d38cbf26
......@@ -2225,7 +2225,6 @@ static void __init mx6_arm2_reserve(void)
if (imx6_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(
imx6_gpu_pdata.reserved_mem_size, SZ_4K, SZ_2G);
memblock_free(phys, imx6_gpu_pdata.reserved_mem_size);
memblock_remove(phys, imx6_gpu_pdata.reserved_mem_size);
imx6_gpu_pdata.reserved_mem_base = phys;
}
......
......@@ -1640,7 +1640,6 @@ static void __init mx6q_reserve(void)
if (imx6q_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
SZ_4K, SZ_2G);
memblock_free(phys, imx6q_gpu_pdata.reserved_mem_size);
memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);
imx6q_gpu_pdata.reserved_mem_base = phys;
}
......
......@@ -1243,7 +1243,6 @@ static void __init mx6q_sabrelite_reserve(void)
if (imx6q_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
SZ_4K, SZ_1G);
memblock_free(phys, imx6q_gpu_pdata.reserved_mem_size);
memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);
imx6q_gpu_pdata.reserved_mem_base = phys;
}
......
......@@ -1896,7 +1896,6 @@ static void __init mx6q_sabresd_reserve(void)
if (imx6q_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
SZ_4K, SZ_1G);
memblock_free(phys, imx6q_gpu_pdata.reserved_mem_size);
memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);
imx6q_gpu_pdata.reserved_mem_base = phys;
}
......
......@@ -1313,7 +1313,6 @@ static void __init mx6_arm2_reserve(void)
if (imx6q_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
SZ_4K, MEMBLOCK_ALLOC_ACCESSIBLE);
memblock_free(phys, imx6q_gpu_pdata.reserved_mem_size);
memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);
imx6q_gpu_pdata.reserved_mem_base = phys;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment