Commit bc16a759 authored by Nathan Lynch's avatar Nathan Lynch Committed by Paul Mackerras

[PATCH] powerpc numa: Consolidate handling of Power4 special case

Code to handle Power4's invalid node id (0xffff) is duplicated for cpu
and memory.  Better to handle this case in one place --
of_node_to_nid.  Overall behavior should be unchanged.
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent cf950b7a
...@@ -207,6 +207,11 @@ static int of_node_to_nid(struct device_node *device) ...@@ -207,6 +207,11 @@ static int of_node_to_nid(struct device_node *device)
device->full_name); device->full_name);
nid = 0; nid = 0;
} }
/* POWER4 LPAR uses 0xffff as invalid node */
if (nid == 0xffff)
nid = 0;
return nid; return nid;
} }
...@@ -297,14 +302,9 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu) ...@@ -297,14 +302,9 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
nid = of_node_to_nid(cpu); nid = of_node_to_nid(cpu);
if (nid >= num_online_nodes()) { if (nid >= num_online_nodes()) {
/* printk(KERN_ERR "WARNING: cpu %ld "
* POWER4 LPAR uses 0xffff as invalid node, "maps to invalid NUMA node %d\n",
* dont warn in this case. lcpu, nid);
*/
if (nid != 0xffff)
printk(KERN_ERR "WARNING: cpu %ld "
"maps to invalid NUMA node %d\n",
lcpu, nid);
nid = 0; nid = 0;
} }
out: out:
...@@ -442,10 +442,9 @@ new_range: ...@@ -442,10 +442,9 @@ new_range:
nid = of_node_to_nid(memory); nid = of_node_to_nid(memory);
if (nid >= MAX_NUMNODES) { if (nid >= MAX_NUMNODES) {
if (nid != 0xffff) printk(KERN_ERR "WARNING: memory at %lx maps "
printk(KERN_ERR "WARNING: memory at %lx maps " "to invalid NUMA node %d\n", start,
"to invalid NUMA node %d\n", start, nid);
nid);
nid = 0; nid = 0;
} }
......
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