diff mbox

[RFC,03/24] xen/dts: Don't check the number of address and size cells in process_cpu_node

Message ID 1376687156-6737-4-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall Aug. 16, 2013, 9:05 p.m. UTC
The properties #address-cells and #size-cells is not required in /cpus node in
the device tree (see Linux Documentation/devicetree/booting-without-of.txt
Section III.5.a).

In the OMAP5 device tree, these 2 properties are not defined. Therefore, Xen
will only able to handle 1 CPU.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
CC: andrii.anisov@globallogic.com
CC: baozich@gmail.com
---
 xen/common/device_tree.c |    6 ------
 1 file changed, 6 deletions(-)

Comments

Chen Baozi Aug. 19, 2013, 12:59 a.m. UTC | #1
On Aug 17, 2013, at 5:05 AM, Julien Grall <julien.grall@linaro.org> wrote:

> The properties #address-cells and #size-cells is not required in /cpus node in
> the device tree (see Linux Documentation/devicetree/booting-without-of.txt
> Section III.5.a).
> 
> In the OMAP5 device tree, these 2 properties are not defined. Therefore, Xen
> will only able to handle 1 CPU.

Well, these 2 properties are defined in the latest upstream codes. They are just
not defined in the kernel tree shipped with TI devboard which version is 3.8.2.

For the others, this patch looks good for me.

> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> CC: andrii.anisov@globallogic.com
> CC: baozich@gmail.com
Acked-by: Chen Baozi <baozich@gmail.com>

> ---
> xen/common/device_tree.c |    6 ------
> 1 file changed, 6 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 84d704d..51f23eb 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -414,12 +414,6 @@ static void __init process_cpu_node(const void *fdt, int node,
>     const u32 *cell;
>     paddr_t start, size;
> 
> -    if ( address_cells != 1 || size_cells != 0 )
> -    {
> -        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> -                     name);
> -        return;
> -    }
> 
>     prop = fdt_get_property(fdt, node, "reg", NULL);
>     if ( !prop )
> -- 
> 1.7.10.4
>
Ian Campbell Aug. 22, 2013, 12:51 p.m. UTC | #2
On Fri, 2013-08-16 at 22:05 +0100, Julien Grall wrote:
> The properties #address-cells and #size-cells is not required in /cpus node in
> the device tree (see Linux Documentation/devicetree/booting-without-of.txt
> Section III.5.a).

This isn't quite accurate, the properties must exist somewhere, if not
here then in the parent node, recursively, otherwise we cannot interpret
the reg properties etc. What isn't required is that they have the
particular values we are checking for.

> 
> In the OMAP5 device tree, these 2 properties are not defined. Therefore, Xen
> will only able to handle 1 CPU.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> CC: andrii.anisov@globallogic.com
> CC: baozich@gmail.com
> ---
>  xen/common/device_tree.c |    6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 84d704d..51f23eb 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -414,12 +414,6 @@ static void __init process_cpu_node(const void *fdt, int node,
>      const u32 *cell;
>      paddr_t start, size;
>  
> -    if ( address_cells != 1 || size_cells != 0 )
> -    {
> -        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> -                     name);
> -        return;
> -    }
>  
>      prop = fdt_get_property(fdt, node, "reg", NULL);
>      if ( !prop )
Julien Grall Aug. 22, 2013, 1:14 p.m. UTC | #3
On 08/22/2013 01:51 PM, Ian Campbell wrote:
> On Fri, 2013-08-16 at 22:05 +0100, Julien Grall wrote:
>> The properties #address-cells and #size-cells is not required in /cpus node in
>> the device tree (see Linux Documentation/devicetree/booting-without-of.txt
>> Section III.5.a).
> 
> This isn't quite accurate, the properties must exist somewhere, if not
> here then in the parent node, recursively, otherwise we cannot interpret
> the reg properties etc. What isn't required is that they have the
> particular values we are checking for.

What about:

The properties #address-cells and #size-cells may not correctly defines
for CPUs node (see /Documentation/devicetree/booting-without-of.txt).

>>
>> In the OMAP5 device tree, these 2 properties are not defined. Therefore, Xen
>> will only able to handle 1 CPU.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> CC: andrii.anisov@globallogic.com
>> CC: baozich@gmail.com
>> ---
>>  xen/common/device_tree.c |    6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
>> index 84d704d..51f23eb 100644
>> --- a/xen/common/device_tree.c
>> +++ b/xen/common/device_tree.c
>> @@ -414,12 +414,6 @@ static void __init process_cpu_node(const void *fdt, int node,
>>      const u32 *cell;
>>      paddr_t start, size;
>>  
>> -    if ( address_cells != 1 || size_cells != 0 )
>> -    {
>> -        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
>> -                     name);
>> -        return;
>> -    }
>>  
>>      prop = fdt_get_property(fdt, node, "reg", NULL);
>>      if ( !prop )
> 
>
Ian Campbell Aug. 22, 2013, 2:05 p.m. UTC | #4
On Thu, 2013-08-22 at 14:14 +0100, Julien Grall wrote:
> On 08/22/2013 01:51 PM, Ian Campbell wrote:
> > On Fri, 2013-08-16 at 22:05 +0100, Julien Grall wrote:
> >> The properties #address-cells and #size-cells is not required in /cpus node in
> >> the device tree (see Linux Documentation/devicetree/booting-without-of.txt
> >> Section III.5.a).
> > 
> > This isn't quite accurate, the properties must exist somewhere, if not
> > here then in the parent node, recursively, otherwise we cannot interpret
> > the reg properties etc. What isn't required is that they have the
> > particular values we are checking for.
> 
> What about:
> 
> The properties #address-cells and #size-cells may not correctly defines
> for CPUs node (see /Documentation/devicetree/booting-without-of.txt).

I don't think that's quite right either. #address-calls is still defined
for /cpus/ even if /cpus/ doesn't itself contain a that property,
because the parent's #address-cells is used in that case (I think
recursively, so grand-parents if the parent doesn't have it, I'm not
100% sure of that though).

I think you just want to say something along the lines of "CPU nodes are
not required to have #address-cells == 1 and #size-cells == 0, so don't
check for that".

> 
> >>
> >> In the OMAP5 device tree, these 2 properties are not defined. Therefore, Xen
> >> will only able to handle 1 CPU.
> >>
> >> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> >> CC: andrii.anisov@globallogic.com
> >> CC: baozich@gmail.com
> >> ---
> >>  xen/common/device_tree.c |    6 ------
> >>  1 file changed, 6 deletions(-)
> >>
> >> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> >> index 84d704d..51f23eb 100644
> >> --- a/xen/common/device_tree.c
> >> +++ b/xen/common/device_tree.c
> >> @@ -414,12 +414,6 @@ static void __init process_cpu_node(const void *fdt, int node,
> >>      const u32 *cell;
> >>      paddr_t start, size;
> >>  
> >> -    if ( address_cells != 1 || size_cells != 0 )
> >> -    {
> >> -        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> >> -                     name);
> >> -        return;
> >> -    }
> >>  
> >>      prop = fdt_get_property(fdt, node, "reg", NULL);
> >>      if ( !prop )
> > 
> > 
> 
>
diff mbox

Patch

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 84d704d..51f23eb 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -414,12 +414,6 @@  static void __init process_cpu_node(const void *fdt, int node,
     const u32 *cell;
     paddr_t start, size;
 
-    if ( address_cells != 1 || size_cells != 0 )
-    {
-        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
-                     name);
-        return;
-    }
 
     prop = fdt_get_property(fdt, node, "reg", NULL);
     if ( !prop )