diff mbox series

common: memtop: Update the MEM_RGN_COUNT macro to 64

Message ID 20250704084224.675703-1-venkatesh.abbarapu@amd.com
State Needs Review / ACK
Delegated to: Tom Rini
Headers show
Series common: memtop: Update the MEM_RGN_COUNT macro to 64 | expand

Commit Message

Venkatesh Yadav Abbarapu July 4, 2025, 8:42 a.m. UTC
Crashes are occurring due to the number of reserved memory regions
exceeding the current maximum limit of 16. It is recommended to
increase the supported number of memory regions to 64, as newer
platforms may utilize more reserved regions.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
---
 common/memtop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Quentin Schulz July 14, 2025, 12:49 p.m. UTC | #1
Hi Venkatesh Yadav Abbarapu,

On 7/4/25 10:42 AM, Venkatesh Yadav Abbarapu wrote:
> Crashes are occurring due to the number of reserved memory regions

I assume these crashes are triggered by

assert_noisy(total < MEM_RGN_COUNT);

in fdt_add_reserved_regions?

Or maybe we're missing some checks in some other places? Or are those 
crashes in the Linux kernel (or whatever OS after U-Boot) because we're 
not adding all reserved memory nodes and the kernel tries to use some 
that should be reserved?

I'm also wondering if we couldn't dynamically allocate rgn array instead 
of hardcoding the size of it (considering we store its size in count 
member I believe?).

Looks ok to me otherwise, just that it unnecessarily increases the 
binary size for systems with fewer than 16 reserved memory areas (which 
I assume is most systems).

Cheers,
Quentin
diff mbox series

Patch

diff --git a/common/memtop.c b/common/memtop.c
index bff27d8211e..8ad394193f3 100644
--- a/common/memtop.c
+++ b/common/memtop.c
@@ -9,7 +9,7 @@ 
 
 #include <asm/types.h>
 
-#define MEM_RGN_COUNT	16
+#define MEM_RGN_COUNT	64
 
 struct region {
 	phys_addr_t base;