diff mbox

[Xen-devel] xen: arm: ignore zero sized memory banks

Message ID 1404142700-16095-1-git-send-email-ian.campbell@citrix.com
State Accepted
Commit 9559d3d04d6be3a298f763dd68bbe7452c1f317d
Headers show

Commit Message

Ian Campbell June 30, 2014, 3:38 p.m. UTC
At least one platform (xgene) has a memory node which contains 4
banks, 3 of which are all zeroes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Stefano Stabellini June 30, 2014, 7:12 p.m. UTC | #1
On Mon, 30 Jun 2014, Ian Campbell wrote:
> At least one platform (xgene) has a memory node which contains 4
> banks, 3 of which are all zeroes.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

>  xen/common/device_tree.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index f0b17a3..556061a 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -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++;
> -- 
> 1.7.10.4
>
Julien Grall July 1, 2014, 1:13 p.m. UTC | #2
Hi Ian,

On 06/30/2014 04:38 PM, Ian Campbell wrote:
> At least one platform (xgene) has a memory node which contains 4
> banks, 3 of which are all zeroes.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>

Regards,
diff mbox

Patch

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index f0b17a3..556061a 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -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++;