of: Fix cpu node iterator to not ignore disabled cpu nodes
authorRob Herring <robh@kernel.org>
Wed, 31 Oct 2018 14:28:06 +0000 (09:28 -0500)
committerRob Herring <robh@kernel.org>
Thu, 1 Nov 2018 21:16:54 +0000 (16:16 -0500)
In most cases, nodes with 'status = "disabled";' are treated as if the
node is not present though it is a common bug to forget to check that.
However, cpu nodes are different in that "disabled" simply means offline
and the OS can bring the CPU core online. Commit f1f207e43b8a ("of: Add
cpu node iterator for_each_of_cpu_node()") followed the common behavior
of ignoring disabled cpu nodes. This breaks some powerpc systems (at
least NXP P50XX/e5500). Fix this by dropping the status check.

Fixes: 651d44f9679c ("of: use for_each_of_cpu_node iterator")
Fixes: f1f207e43b8a ("of: Add cpu node iterator for_each_of_cpu_node()")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>

index cc62da27866383c8d34cc1c8a8364ed8ebbf9526..e47c5ce6cd58951254c79e3aef98e986b66bce6d 100644 (file)
@@ -776,8 +776,6 @@ struct device_node *of_get_next_cpu_node(struct device_node *prev)
                if (!(of_node_name_eq(next, "cpu") ||
                      (next->type && !of_node_cmp(next->type, "cpu"))))
-               if (!__of_device_is_available(next))
-                       continue;
                if (of_node_get(next))