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:
Charan Teja Reddy 2019-11-01 19:24:12 +05:30 • committed by Isaac J. Manjarres
commit 703ccaaab4

View file

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