* [PATCH 00/21] DT cpu node iterator
@ 2018-09-05 19:37 Rob Herring
2018-09-05 19:37 ` [PATCH 14/21] riscv: use for_each_of_cpu_node iterator Rob Herring
[not found] ` <CAHTX3d+BFKM-jFo8Ww_dXwAzsDVoWqE==erfwVTeijHfh8kkOw@mail.gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Rob Herring @ 2018-09-05 19:37 UTC (permalink / raw)
To: linux-riscv
This series adds an iterator for cpu nodes and converts users over to use
it or of_get_cpu_node in some cases. This allows us to remove the
dependency on device_type property for cpu nodes though removing that
from DTS files will have to wait for some time. In some cases, this makes
the DT search more strict by only looking in /cpus child nodes rather
than any node with the device_type == cpu. The iterator also honors the
status property which is often forgotten.
I've only tested on ARM under QEMU and compiled powerpc.
Rob
Rob Herring (21):
of: Add cpu node iterator for_each_of_cpu_node()
of: Support matching cpu nodes with no 'reg' property
ARM: use for_each_of_cpu_node iterator
ARM: topology: remove unneeded check for /cpus node
ARM: shmobile: use for_each_of_cpu_node iterator
arm64: use for_each_of_cpu_node iterator
c6x: use for_each_of_cpu_node iterator
microblaze: get cpu node with of_get_cpu_node
nios2: get cpu node with of_get_cpu_node
openrisc: use for_each_of_cpu_node iterator
powerpc: use for_each_of_cpu_node iterator
powerpc: 4xx: get cpu node with of_get_cpu_node
powerpc: 8xx: get cpu node with of_get_cpu_node
riscv: use for_each_of_cpu_node iterator
SH: use for_each_of_cpu_node iterator
x86: DT: use for_each_of_cpu_node iterator
clk: mvebu: use for_each_of_cpu_node iterator
edac: cpc925: use for_each_of_cpu_node iterator
iommu: fsl_pamu: use for_each_of_cpu_node iterator
of: use for_each_of_cpu_node iterator
fbdev: fsl-diu: get cpu node with of_get_cpu_node
arch/arm/kernel/devtree.c | 5 +--
arch/arm/kernel/topology.c | 6 ---
arch/arm/mach-shmobile/pm-rcar-gen2.c | 8 +---
arch/arm/mach-shmobile/pm-rmobile.c | 2 +-
arch/arm/mach-shmobile/timer.c | 10 +----
arch/arm64/kernel/smp.c | 2 +-
arch/c6x/kernel/setup.c | 11 ++---
arch/microblaze/kernel/cpu/cpuinfo.c | 4 +-
arch/nios2/kernel/cpuinfo.c | 4 +-
arch/openrisc/kernel/setup.c | 3 +-
arch/powerpc/platforms/4xx/soc.c | 2 +-
arch/powerpc/platforms/8xx/m8xx_setup.c | 5 ++-
arch/powerpc/platforms/powermac/feature.c | 51 ++++++++---------------
arch/powerpc/platforms/powermac/setup.c | 15 +++----
arch/riscv/kernel/smpboot.c | 2 +-
arch/sh/boards/of-generic.c | 2 +-
arch/x86/kernel/devicetree.c | 2 +-
drivers/clk/mvebu/clk-cpu.c | 4 +-
drivers/edac/cpc925_edac.c | 20 +--------
drivers/iommu/fsl_pamu.c | 2 +-
drivers/of/base.c | 43 ++++++++++++++++++-
drivers/of/of_numa.c | 15 +------
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
include/linux/of.h | 11 +++++
24 files changed, 111 insertions(+), 120 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 14/21] riscv: use for_each_of_cpu_node iterator
2018-09-05 19:37 [PATCH 00/21] DT cpu node iterator Rob Herring
@ 2018-09-05 19:37 ` Rob Herring
2018-09-10 13:37 ` Christoph Hellwig
2018-09-18 22:53 ` Palmer Dabbelt
[not found] ` <CAHTX3d+BFKM-jFo8Ww_dXwAzsDVoWqE==erfwVTeijHfh8kkOw@mail.gmail.com>
1 sibling, 2 replies; 6+ messages in thread
From: Rob Herring @ 2018-09-05 19:37 UTC (permalink / raw)
To: linux-riscv
Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
has the side effect of defaulting to iterating using "cpu" node names in
preference to the deprecated (for FDT) device_type == "cpu".
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv at lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
Please ack and I will take via the DT tree. This is dependent on the
first 2 patches.
arch/riscv/kernel/smpboot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
index 56abab6a9812..3c59afe67951 100644
--- a/arch/riscv/kernel/smpboot.c
+++ b/arch/riscv/kernel/smpboot.c
@@ -52,7 +52,7 @@ void __init setup_smp(void)
struct device_node *dn = NULL;
int hart, im_okay_therefore_i_am = 0;
- while ((dn = of_find_node_by_type(dn, "cpu"))) {
+ for_each_of_cpu_node(dn) {
hart = riscv_of_processor_hart(dn);
if (hart >= 0) {
set_cpu_possible(hart, true);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 00/21] DT cpu node iterator
[not found] ` <CAHTX3d+BFKM-jFo8Ww_dXwAzsDVoWqE==erfwVTeijHfh8kkOw@mail.gmail.com>
@ 2018-09-07 13:58 ` Rob Herring
0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2018-09-07 13:58 UTC (permalink / raw)
To: linux-riscv
On Fri, Sep 7, 2018 at 7:54 AM Michal Simek <monstr@monstr.eu> wrote:
>
> Hi Rob,
>
> 2018-09-05 21:37 GMT+02:00 Rob Herring <robh@kernel.org>:
>>
>> This series adds an iterator for cpu nodes and converts users over to use
>> it or of_get_cpu_node in some cases. This allows us to remove the
>> dependency on device_type property for cpu nodes though removing that
>> from DTS files will have to wait for some time. In some cases, this makes
>> the DT search more strict by only looking in /cpus child nodes rather
>> than any node with the device_type == cpu. The iterator also honors the
>> status property which is often forgotten.
>>
>> I've only tested on ARM under QEMU and compiled powerpc.
>
>
>
> Do you have this somewhere in your tree not to apply 21 patches by hand?
Yes, dt/cpu-type branch on my kernel.org tree.
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 14/21] riscv: use for_each_of_cpu_node iterator
2018-09-05 19:37 ` [PATCH 14/21] riscv: use for_each_of_cpu_node iterator Rob Herring
@ 2018-09-10 13:37 ` Christoph Hellwig
2018-09-10 13:51 ` Rob Herring
2018-09-18 22:53 ` Palmer Dabbelt
1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2018-09-10 13:37 UTC (permalink / raw)
To: linux-riscv
On Wed, Sep 05, 2018 at 02:37:31PM -0500, Rob Herring wrote:
> Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
> has the side effect of defaulting to iterating using "cpu" node names in
> preference to the deprecated (for FDT) device_type == "cpu".
>
> Cc: Palmer Dabbelt <palmer@sifive.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv at lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Please ack and I will take via the DT tree. This is dependent on the
> first 2 patches.
We have a few pending patches in this area that look like they might
conflict. It might be worth to delay this one and apply it post -rc1
to avoid dependencies if that isn't a problem for you.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 14/21] riscv: use for_each_of_cpu_node iterator
2018-09-10 13:37 ` Christoph Hellwig
@ 2018-09-10 13:51 ` Rob Herring
0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2018-09-10 13:51 UTC (permalink / raw)
To: linux-riscv
On Mon, Sep 10, 2018 at 8:38 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Wed, Sep 05, 2018 at 02:37:31PM -0500, Rob Herring wrote:
> > Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
> > has the side effect of defaulting to iterating using "cpu" node names in
> > preference to the deprecated (for FDT) device_type == "cpu".
> >
> > Cc: Palmer Dabbelt <palmer@sifive.com>
> > Cc: Albert Ou <aou@eecs.berkeley.edu>
> > Cc: linux-riscv at lists.infradead.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> > Please ack and I will take via the DT tree. This is dependent on the
> > first 2 patches.
>
> We have a few pending patches in this area that look like they might
> conflict. It might be worth to delay this one and apply it post -rc1
> to avoid dependencies if that isn't a problem for you.
Sure. That's fine.
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 14/21] riscv: use for_each_of_cpu_node iterator
2018-09-05 19:37 ` [PATCH 14/21] riscv: use for_each_of_cpu_node iterator Rob Herring
2018-09-10 13:37 ` Christoph Hellwig
@ 2018-09-18 22:53 ` Palmer Dabbelt
1 sibling, 0 replies; 6+ messages in thread
From: Palmer Dabbelt @ 2018-09-18 22:53 UTC (permalink / raw)
To: linux-riscv
On Wed, 05 Sep 2018 12:37:31 PDT (-0700), robh at kernel.org wrote:
> Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
> has the side effect of defaulting to iterating using "cpu" node names in
> preference to the deprecated (for FDT) device_type == "cpu".
>
> Cc: Palmer Dabbelt <palmer@sifive.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv at lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Please ack and I will take via the DT tree. This is dependent on the
> first 2 patches.
>
> arch/riscv/kernel/smpboot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
> index 56abab6a9812..3c59afe67951 100644
> --- a/arch/riscv/kernel/smpboot.c
> +++ b/arch/riscv/kernel/smpboot.c
> @@ -52,7 +52,7 @@ void __init setup_smp(void)
> struct device_node *dn = NULL;
> int hart, im_okay_therefore_i_am = 0;
>
> - while ((dn = of_find_node_by_type(dn, "cpu"))) {
> + for_each_of_cpu_node(dn) {
> hart = riscv_of_processor_hart(dn);
> if (hart >= 0) {
> set_cpu_possible(hart, true);
Acked-by: Palmer Dabbelt <palmer@sifive.com>
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-18 22:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05 19:37 [PATCH 00/21] DT cpu node iterator Rob Herring
2018-09-05 19:37 ` [PATCH 14/21] riscv: use for_each_of_cpu_node iterator Rob Herring
2018-09-10 13:37 ` Christoph Hellwig
2018-09-10 13:51 ` Rob Herring
2018-09-18 22:53 ` Palmer Dabbelt
[not found] ` <CAHTX3d+BFKM-jFo8Ww_dXwAzsDVoWqE==erfwVTeijHfh8kkOw@mail.gmail.com>
2018-09-07 13:58 ` [PATCH 00/21] DT cpu node iterator Rob Herring
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).