Skip to contentSkip to conversation

xen: arm: ignore zero sized memory banks

PATCH In review Ian Campbell 3 participants 3 messages Jun 30, 2014 – Jul 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: arm: ignore zero sized memory banks

At least one platform (xgene) has a memory node which contains 4 banks, 3 of which are all zeroes.

---
 xen/common/device_tree.c |    2 ++
 1 file changed, 2 insertions(+)
xen/common/device_tree.c +2 -0
index f0b17a3..556061a 100644
@@ -322,6 +322,8 @@ static void __init process_memory_node(const void *fdt, int node,
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
         device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+        if ( !size )
+            continue;
         early_info.mem.bank[early_info.mem.nr_banks].start = start;
         early_info.mem.bank[early_info.mem.nr_banks].size = size;
         early_info.mem.nr_banks++;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ian Campbell

At least one platform (xgene) has a memory node which contains 4 banks, 3 of which are all zeroes.

Quoted 19 lines
 xen/common/device_tree.c |    2 ++
 1 file changed, 2 insertions(+)
xen/common/device_tree.c +2 -0
index f0b17a3..556061a 100644
@@ -322,6 +322,8 @@ static void __init process_memory_node(const void *fdt, int node,
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
         device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+        if ( !size )
+            continue;
         early_info.mem.bank[early_info.mem.nr_banks].start = start;
         early_info.mem.bank[early_info.mem.nr_banks].size = size;
         early_info.mem.nr_banks++;
Signature · 1 line
1.7.10.4