devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: skip disabled CPU nodes
@ 2020-08-26 12:02 Matthias Schiffer
  2020-08-26 13:01 ` Frank Rowand
  0 siblings, 1 reply; 8+ messages in thread
From: Matthias Schiffer @ 2020-08-26 12:02 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: devicetree, linux-kernel, Matthias Schiffer

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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-11 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-26 12:02 [PATCH] of: skip disabled CPU nodes Matthias Schiffer
2020-08-26 13:01 ` Frank Rowand
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

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).