* [PATCH] ARM: kernel: respect device tree status of cpu nodes
@ 2014-02-24 11:22 Jürg Billeter
2014-03-05 20:33 ` Stephen Boyd
0 siblings, 1 reply; 4+ messages in thread
From: Jürg Billeter @ 2014-02-24 11:22 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, devicetree, Jürg Billeter, linux-kernel
Skip 'disabled' cpu nodes when building the cpu logical map. This avoids
booting cpus that have been disabled in the device tree.
Signed-off-by: Jürg Billeter <j@bitron.ch>
Reviewed-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
arch/arm/kernel/devtree.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 739c3df..9aed299 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -95,6 +95,10 @@ void __init arm_dt_init_cpu_maps(void)
if (of_node_cmp(cpu->type, "cpu"))
continue;
+ /* Check if CPU is enabled */
+ if (!of_device_is_available(cpu))
+ continue;
+
pr_debug(" * %s...\n", cpu->full_name);
/*
* A device tree containing CPU nodes with missing "reg"
--
1.9.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ARM: kernel: respect device tree status of cpu nodes
2014-02-24 11:22 [PATCH] ARM: kernel: respect device tree status of cpu nodes Jürg Billeter
@ 2014-03-05 20:33 ` Stephen Boyd
[not found] ` <53178A03.3090004-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2014-03-05 20:33 UTC (permalink / raw)
To: Jürg Billeter
Cc: linux-arm-kernel, linux-kernel, devicetree,
Linux Kernel Mailing List, Lorenzo Pieralisi
+Lorenzo
On 02/24/14 03:22, Jürg Billeter wrote:
> Skip 'disabled' cpu nodes when building the cpu logical map. This avoids
> booting cpus that have been disabled in the device tree.
>
> Signed-off-by: Jürg Billeter <j@bitron.ch>
> Reviewed-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> arch/arm/kernel/devtree.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index 739c3df..9aed299 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
> @@ -95,6 +95,10 @@ void __init arm_dt_init_cpu_maps(void)
> if (of_node_cmp(cpu->type, "cpu"))
> continue;
>
> + /* Check if CPU is enabled */
> + if (!of_device_is_available(cpu))
> + continue;
> +
> pr_debug(" * %s...\n", cpu->full_name);
> /*
> * A device tree containing CPU nodes with missing "reg"
This doesn't follow the ePAPR spec. According to ePAPR status="disabled"
in a cpu node means "the cpu is in a quiescent state" and one can enable
it by using the "enable-method". At the least, we should document this
in bindings/arm/cpus.txt if we can all agree that we want this
definition of disabled.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Linux-kernel] [PATCH] ARM: kernel: respect device tree status of cpu nodes
[not found] ` <53178A03.3090004-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2014-03-06 10:00 ` Ben Dooks
[not found] ` <5318472A.5060700-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2014-03-06 10:00 UTC (permalink / raw)
To: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO,
open list:OPEN FIRMWARE AND..., Lorenzon Pieralisi,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 05/03/14 20:33, Stephen Boyd wrote:
> +Lorenzo
>
> On 02/24/14 03:22, Jürg Billeter wrote:
>> Skip 'disabled' cpu nodes when building the cpu logical map. This avoids
>> booting cpus that have been disabled in the device tree.
>>
>> Signed-off-by: Jürg Billeter <j@bitron.ch>
>> Reviewed-by: Ben Dooks <ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
>> ---
>> arch/arm/kernel/devtree.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
>> index 739c3df..9aed299 100644
>> --- a/arch/arm/kernel/devtree.c
>> +++ b/arch/arm/kernel/devtree.c
>> @@ -95,6 +95,10 @@ void __init arm_dt_init_cpu_maps(void)
>> if (of_node_cmp(cpu->type, "cpu"))
>> continue;
>>
>> + /* Check if CPU is enabled */
>> + if (!of_device_is_available(cpu))
>> + continue;
>> +
>> pr_debug(" * %s...\n", cpu->full_name);
>> /*
>> * A device tree containing CPU nodes with missing "reg"
>
> This doesn't follow the ePAPR spec. According to ePAPR status="disabled"
> in a cpu node means "the cpu is in a quiescent state" and one can enable
> it by using the "enable-method". At the least, we should document this
> in bindings/arm/cpus.txt if we can all agree that we want this
> definition of disabled.
My view was that disabled should be the same as for the device case
as it makes sense that way.
We have a position where we want to use the .dtsi files but not all
cpus are available to the Linux. If we cannot use disabled then we
need some other method to say this cpu node is not available, so
please do not try and bring it online (saves boot time waiting for
CPU nodes that cannot online)
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Linux-kernel] [PATCH] ARM: kernel: respect device tree status of cpu nodes
[not found] ` <5318472A.5060700-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
@ 2014-03-06 16:51 ` Lorenzo Pieralisi
0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2014-03-06 16:51 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO@public.gmane.org,
open list:OPEN FIRMWARE AND...,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
[CC'in BenH and Grant to check how this is handled in powerPC]
On Thu, Mar 06, 2014 at 10:00:10AM +0000, Ben Dooks wrote:
> On 05/03/14 20:33, Stephen Boyd wrote:
> > +Lorenzo
> >
> > On 02/24/14 03:22, Jürg Billeter wrote:
> >> Skip 'disabled' cpu nodes when building the cpu logical map. This avoids
> >> booting cpus that have been disabled in the device tree.
> >>
> >> Signed-off-by: Jürg Billeter <j@bitron.ch>
> >> Reviewed-by: Ben Dooks <ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
> >> ---
> >> arch/arm/kernel/devtree.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> >> index 739c3df..9aed299 100644
> >> --- a/arch/arm/kernel/devtree.c
> >> +++ b/arch/arm/kernel/devtree.c
> >> @@ -95,6 +95,10 @@ void __init arm_dt_init_cpu_maps(void)
> >> if (of_node_cmp(cpu->type, "cpu"))
> >> continue;
> >>
> >> + /* Check if CPU is enabled */
> >> + if (!of_device_is_available(cpu))
> >> + continue;
> >> +
> >> pr_debug(" * %s...\n", cpu->full_name);
> >> /*
> >> * A device tree containing CPU nodes with missing "reg"
> >
> > This doesn't follow the ePAPR spec. According to ePAPR status="disabled"
> > in a cpu node means "the cpu is in a quiescent state" and one can enable
> > it by using the "enable-method". At the least, we should document this
> > in bindings/arm/cpus.txt if we can all agree that we want this
> > definition of disabled.
>
> My view was that disabled should be the same as for the device case
> as it makes sense that way.
Ok, it has been brought up before.
ePAPR v1.1, 2.3.4 "status"
"disabled" - Indicates that the device is not presently operational, but
it might become operational in the future (for example,
something is not plugged in, or switched off).
Refer to the device binding for details on what disabled means
for a given device.
So "disabled" for devices does not read that different to me to what
Stephen mentioned for a CPU.
After all you just want the CPU node to be ignored, and that's not a CPU
status, it is a DT trick to use one .dtsi for multiple boot scenarios.
I wonder how the status property has been used on powerPC.
By grepping the sources, it is checked in arch/powerpc/kernel/prom_init.c
and that's just to check CPU that are already in status =="okay", so
they can be put in a holding loop (I guess).
It should be fine to deviate from the ePAPR and consider using:
status = "disabled"
for your aim (it has been ignored so far on all ARM platforms I am aware
of, so this should not break the kernel).
We need to update cpus.txt accordingly and override it for ARM.
> We have a position where we want to use the .dtsi files but not all
> cpus are available to the Linux. If we cannot use disabled then we
> need some other method to say this cpu node is not available, so
> please do not try and bring it online (saves boot time waiting for
> CPU nodes that cannot online)
Understood, see above.
Lorenzo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-06 16:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 11:22 [PATCH] ARM: kernel: respect device tree status of cpu nodes Jürg Billeter
2014-03-05 20:33 ` Stephen Boyd
[not found] ` <53178A03.3090004-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-03-06 10:00 ` [Linux-kernel] " Ben Dooks
[not found] ` <5318472A.5060700-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2014-03-06 16:51 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).