devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
	Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: skip disabled CPU nodes
Date: Wed, 26 Aug 2020 08:01:49 -0500	[thread overview]
Message-ID: <4dd06b79-1402-d7cf-9676-1f9a9526da12@gmail.com> (raw)
In-Reply-To: <20200826120254.8902-1-matthias.schiffer@ew.tq-group.com>

On 2020-08-26 07:02, Matthias Schiffer wrote:
> Allow disabling CPU nodes using status = "disabled".
> 
> This allows a bootloader to change the number of available CPUs (for
> example when a common DTS is used for SoC variants with different numbers
> of cores) without deleting the nodes altogether (which may require
> additional fixups where the CPU nodes are referenced, e.g. a cooling
> map).
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
>  drivers/of/base.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index ea44fea99813..d547e9deced1 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -796,6 +796,8 @@ struct device_node *of_get_next_cpu_node(struct device_node *prev)
>  		of_node_put(node);
>  	}
>  	for (; next; next = next->sibling) {
> +		if (!__of_device_is_available(next))
> +			continue;
>  		if (!(of_node_name_eq(next, "cpu") ||
>  		      __of_node_is_type(next, "cpu")))
>  			continue;
> 

The original implementation of of_get_next_cpu_node() had
that check, but status disabled for cpu nodes has different
semantics than other nodes, and the check broke some systems.
The check was removed by c961cb3be906 "of: Fix cpu node
iterator to not ignore disabled cpu nodes".

It would be useful to document that difference in the
header comment of of_get_next_cpu_node().

-Frank

  reply	other threads:[~2020-08-26 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 12:02 [PATCH] of: skip disabled CPU nodes Matthias Schiffer
2020-08-26 13:01 ` Frank Rowand [this message]
2020-08-26 13:54   ` (EXT) " Matthias Schiffer
2020-08-26 14:47     ` Frank Rowand
2020-08-26 19:26       ` Rob Herring
2020-08-27  7:10         ` (EXT) " Matthias Schiffer
2020-09-09  8:57           ` Matthias Schiffer
2020-09-11 14:43             ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4dd06b79-1402-d7cf-9676-1f9a9526da12@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).