Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f781e3e authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

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: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent a0e0de01
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -330,6 +330,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);

@@ -340,6 +341,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) {