From 17322ee4f97584222f172b48389367b35f9bc436 Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Wed, 26 Feb 2025 14:33:05 -0800 Subject: [PATCH] Revert "of: reserved-memory: Fix using wrong number of cells to get property 'alignment'" This reverts commit bcf0fb1a4600bae55f4b8417e12fac404ddc5e3c due to breaking parsing of reserved memory with the `alignment` property when reserved memory defines the `alignment` property with `#address-cells != #size-cells`. RobH plans to revert this change as well [1]. Let's preemptively revert this in GKI to not break any downstream devices in the meantime. [1] https://lore.kernel.org/lkml/20250226194505.GA3407277-robh@kernel.org/ Bug: 399400888 Signed-off-by: Will McVicker Change-Id: I276e47a7f133f9d4196d853801581b5dec809b99 --- drivers/of/of_reserved_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index e45d6d3a8dc6..45445a1600a9 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -360,12 +360,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam prop = of_get_flat_dt_prop(node, "alignment", &len); if (prop) { - if (len != dt_root_size_cells * sizeof(__be32)) { + if (len != dt_root_addr_cells * sizeof(__be32)) { pr_err("invalid alignment property in '%s' node.\n", uname); return -EINVAL; } - align = dt_mem_next_cell(dt_root_size_cells, &prop); + align = dt_mem_next_cell(dt_root_addr_cells, &prop); } nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL;