arm64: topology: Warn if the root node contains CPUs directly
authorMark Brown <broonie@linaro.org>
Tue, 7 Jan 2014 18:41:49 +0000 (18:41 +0000)
committerMark Brown <broonie@linaro.org>
Wed, 8 Jan 2014 12:15:57 +0000 (12:15 +0000)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/kernel/topology.c

index 1c6a65e3aa993f7b3b80b31980ed65cfa086f681..cb6e0397bec72eadbcbf7231dd2e95054c8f153e 100644 (file)
@@ -143,7 +143,7 @@ static void __init parse_core(struct device_node *core, int core_id)
        }
 }
 
-static void __init parse_cluster(struct device_node *cluster)
+static void __init parse_cluster(struct device_node *cluster, int depth)
 {
        char name[10];
        bool leaf = true;
@@ -162,7 +162,7 @@ static void __init parse_cluster(struct device_node *cluster)
                snprintf(name, sizeof(name), "cluster%d", i);
                c = of_get_child_by_name(cluster, name);
                if (c) {
-                       parse_cluster(c);
+                       parse_cluster(c, depth + 1);
                        leaf = false;
                }
                i++;
@@ -176,6 +176,10 @@ static void __init parse_cluster(struct device_node *cluster)
                if (c) {
                        has_cores = true;
 
+                       if (depth == 0)
+                               pr_err("%s: cpu-map children should be clusters\n",
+                                      c->full_name);
+
                        if (leaf)
                                parse_core(c, core_id++);
                        else
@@ -225,7 +229,7 @@ static void __init parse_dt_topology(void)
        cn = of_find_node_by_name(cn, "cpu-map");
        if (!cn)
                return;
-       parse_cluster(cn);
+       parse_cluster(cn, 0);
 
        for_each_possible_cpu(cpu) {
                const u32 *rate;