mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
arm64: mm: improve the mem-offline device node availability check
Even if we use status = "disabled" in mem-offline node, still the update_memory_limit() will go and update memory_limit variable and thus the removed memory is never added to system as the mem-offline driver is disabled. Correct this logic. Change-Id: I80102830f0a5a82dcd4cddfaddb0de21bfdd0110 Signed-off-by: Charan Teja Reddy <charante@codeaurora.org> Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
parent
41dfbf027b
commit
703ccaaab4
1 changed files with 7 additions and 0 deletions
|
|
@ -271,6 +271,7 @@ static void __init update_memory_limit(void)
|
|||
phys_addr_t end_addr, addr_aligned, offset;
|
||||
int len;
|
||||
const __be32 *prop;
|
||||
char *status;
|
||||
phys_addr_t min_ddr_sz = 0, offline_sz = 0;
|
||||
int t_len = (2 * dt_root_size_cells) * sizeof(__be32);
|
||||
|
||||
|
|
@ -281,6 +282,12 @@ static void __init update_memory_limit(void)
|
|||
return;
|
||||
}
|
||||
|
||||
status = (char *)fdt_getprop(initial_boot_params, node, "status", NULL);
|
||||
if (status && !strcmp(status, "disabled")) {
|
||||
pr_info("mem-offline device is disabled\n");
|
||||
return;
|
||||
}
|
||||
|
||||
prop = of_get_flat_dt_prop(node, "offline-sizes", &len);
|
||||
if (prop) {
|
||||
if (len % t_len != 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue