arm: tegra: remove memory for ramoops in correct order
Krishna Reddy [Sat, 28 Jun 2014 03:13:05 +0000 (20:13 -0700)]
memory for ramoops need to be removed before cma dev's setup.
more over, the memory need to be removed from mem block instead
of reserve.
Bug 200016405

Change-Id: I62eec6b76719a417a7e6ec6fb5753c289cfb48de
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/432454
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/common.c

index 79f222b..a131deb 100644 (file)
@@ -1856,7 +1856,7 @@ static void __init tegra_reserve_ramoops_memory(unsigned long reserve_size)
        ramoops_data.console_size = reserve_size - FTRACE_MEM_SIZE;
        ramoops_data.ftrace_size = FTRACE_MEM_SIZE;
        ramoops_data.dump_oops = 1;
-       memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);
+       memblock_remove(ramoops_data.mem_address, ramoops_data.mem_size);
 }
 
 static int __init tegra_register_ramoops_device(void)
@@ -2146,6 +2146,10 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
        }
 #endif
 
+#ifdef CONFIG_PSTORE_RAM
+       tegra_reserve_ramoops_memory(RAMOOPS_MEM_SIZE);
+#endif
+
 #ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
        /* Keep these at the end */
        if (carveout_size) {
@@ -2162,9 +2166,6 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
 #endif
 
        tegra_fb_linear_set(map);
-#ifdef CONFIG_PSTORE_RAM
-       tegra_reserve_ramoops_memory(RAMOOPS_MEM_SIZE);
-#endif
 }
 
 void tegra_reserve4(ulong carveout_size, ulong fb_size,