Commit 7e35ef66 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman

powerpc/pseries: rename min_common_depth to primary_domain_index

No functional change in this patch.
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210812132223.225214-2-aneesh.kumar@linux.ibm.com
parent dbf77fed
...@@ -51,7 +51,7 @@ EXPORT_SYMBOL(numa_cpu_lookup_table); ...@@ -51,7 +51,7 @@ EXPORT_SYMBOL(numa_cpu_lookup_table);
EXPORT_SYMBOL(node_to_cpumask_map); EXPORT_SYMBOL(node_to_cpumask_map);
EXPORT_SYMBOL(node_data); EXPORT_SYMBOL(node_data);
static int min_common_depth; static int primary_domain_index;
static int n_mem_addr_cells, n_mem_size_cells; static int n_mem_addr_cells, n_mem_size_cells;
static int form1_affinity; static int form1_affinity;
...@@ -232,8 +232,8 @@ static int associativity_to_nid(const __be32 *associativity) ...@@ -232,8 +232,8 @@ static int associativity_to_nid(const __be32 *associativity)
if (!numa_enabled) if (!numa_enabled)
goto out; goto out;
if (of_read_number(associativity, 1) >= min_common_depth) if (of_read_number(associativity, 1) >= primary_domain_index)
nid = of_read_number(&associativity[min_common_depth], 1); nid = of_read_number(&associativity[primary_domain_index], 1);
/* POWER4 LPAR uses 0xffff as invalid node */ /* POWER4 LPAR uses 0xffff as invalid node */
if (nid == 0xffff || nid >= nr_node_ids) if (nid == 0xffff || nid >= nr_node_ids)
...@@ -284,9 +284,9 @@ int of_node_to_nid(struct device_node *device) ...@@ -284,9 +284,9 @@ int of_node_to_nid(struct device_node *device)
} }
EXPORT_SYMBOL(of_node_to_nid); EXPORT_SYMBOL(of_node_to_nid);
static int __init find_min_common_depth(void) static int __init find_primary_domain_index(void)
{ {
int depth; int index;
struct device_node *root; struct device_node *root;
if (firmware_has_feature(FW_FEATURE_OPAL)) if (firmware_has_feature(FW_FEATURE_OPAL))
...@@ -326,7 +326,7 @@ static int __init find_min_common_depth(void) ...@@ -326,7 +326,7 @@ static int __init find_min_common_depth(void)
} }
if (form1_affinity) { if (form1_affinity) {
depth = of_read_number(distance_ref_points, 1); index = of_read_number(distance_ref_points, 1);
} else { } else {
if (distance_ref_points_depth < 2) { if (distance_ref_points_depth < 2) {
printk(KERN_WARNING "NUMA: " printk(KERN_WARNING "NUMA: "
...@@ -334,7 +334,7 @@ static int __init find_min_common_depth(void) ...@@ -334,7 +334,7 @@ static int __init find_min_common_depth(void)
goto err; goto err;
} }
depth = of_read_number(&distance_ref_points[1], 1); index = of_read_number(&distance_ref_points[1], 1);
} }
/* /*
...@@ -348,7 +348,7 @@ static int __init find_min_common_depth(void) ...@@ -348,7 +348,7 @@ static int __init find_min_common_depth(void)
} }
of_node_put(root); of_node_put(root);
return depth; return index;
err: err:
of_node_put(root); of_node_put(root);
...@@ -437,16 +437,16 @@ int of_drconf_to_nid_single(struct drmem_lmb *lmb) ...@@ -437,16 +437,16 @@ int of_drconf_to_nid_single(struct drmem_lmb *lmb)
int nid = default_nid; int nid = default_nid;
int rc, index; int rc, index;
if ((min_common_depth < 0) || !numa_enabled) if ((primary_domain_index < 0) || !numa_enabled)
return default_nid; return default_nid;
rc = of_get_assoc_arrays(&aa); rc = of_get_assoc_arrays(&aa);
if (rc) if (rc)
return default_nid; return default_nid;
if (min_common_depth <= aa.array_sz && if (primary_domain_index <= aa.array_sz &&
!(lmb->flags & DRCONF_MEM_AI_INVALID) && lmb->aa_index < aa.n_arrays) { !(lmb->flags & DRCONF_MEM_AI_INVALID) && lmb->aa_index < aa.n_arrays) {
index = lmb->aa_index * aa.array_sz + min_common_depth - 1; index = lmb->aa_index * aa.array_sz + primary_domain_index - 1;
nid = of_read_number(&aa.arrays[index], 1); nid = of_read_number(&aa.arrays[index], 1);
if (nid == 0xffff || nid >= nr_node_ids) if (nid == 0xffff || nid >= nr_node_ids)
...@@ -708,18 +708,18 @@ static int __init parse_numa_properties(void) ...@@ -708,18 +708,18 @@ static int __init parse_numa_properties(void)
return -1; return -1;
} }
min_common_depth = find_min_common_depth(); primary_domain_index = find_primary_domain_index();
if (min_common_depth < 0) { if (primary_domain_index < 0) {
/* /*
* if we fail to parse min_common_depth from device tree * if we fail to parse primary_domain_index from device tree
* mark the numa disabled, boot with numa disabled. * mark the numa disabled, boot with numa disabled.
*/ */
numa_enabled = false; numa_enabled = false;
return min_common_depth; return primary_domain_index;
} }
dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth); dbg("NUMA associativity depth for CPU/Memory: %d\n", primary_domain_index);
/* /*
* Even though we connect cpus to numa domains later in SMP * Even though we connect cpus to numa domains later in SMP
...@@ -924,7 +924,7 @@ static void __init find_possible_nodes(void) ...@@ -924,7 +924,7 @@ static void __init find_possible_nodes(void)
goto out; goto out;
} }
max_nodes = of_read_number(&domains[min_common_depth], 1); max_nodes = of_read_number(&domains[primary_domain_index], 1);
pr_info("Partition configured for %d NUMA nodes.\n", max_nodes); pr_info("Partition configured for %d NUMA nodes.\n", max_nodes);
for (i = 0; i < max_nodes; i++) { for (i = 0; i < max_nodes; i++) {
...@@ -933,7 +933,7 @@ static void __init find_possible_nodes(void) ...@@ -933,7 +933,7 @@ static void __init find_possible_nodes(void)
} }
prop_length /= sizeof(int); prop_length /= sizeof(int);
if (prop_length > min_common_depth + 2) if (prop_length > primary_domain_index + 2)
coregroup_enabled = 1; coregroup_enabled = 1;
out: out:
...@@ -1266,7 +1266,7 @@ int cpu_to_coregroup_id(int cpu) ...@@ -1266,7 +1266,7 @@ int cpu_to_coregroup_id(int cpu)
goto out; goto out;
index = of_read_number(associativity, 1); index = of_read_number(associativity, 1);
if (index > min_common_depth + 1) if (index > primary_domain_index + 1)
return of_read_number(&associativity[index - 1], 1); return of_read_number(&associativity[index - 1], 1);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment