Skip to content

Commit

Permalink
[PATCH] powerpc numa: Consolidate handling of Power4 special case
Browse files Browse the repository at this point in the history
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: Nathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Nathan Lynch authored and Paul Mackerras committed Mar 22, 2006
1 parent cf950b7 commit bc16a75
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ static int of_node_to_nid(struct device_node *device)
device->full_name);
nid = 0;
}

/* POWER4 LPAR uses 0xffff as invalid node */
if (nid == 0xffff)
nid = 0;

return nid;
}

Expand Down Expand Up @@ -297,14 +302,9 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
nid = of_node_to_nid(cpu);

if (nid >= num_online_nodes()) {
/*
* POWER4 LPAR uses 0xffff as invalid node,
* dont warn in this case.
*/
if (nid != 0xffff)
printk(KERN_ERR "WARNING: cpu %ld "
"maps to invalid NUMA node %d\n",
lcpu, nid);
printk(KERN_ERR "WARNING: cpu %ld "
"maps to invalid NUMA node %d\n",
lcpu, nid);
nid = 0;
}
out:
Expand Down Expand Up @@ -442,10 +442,9 @@ static int __init parse_numa_properties(void)
nid = of_node_to_nid(memory);

if (nid >= MAX_NUMNODES) {
if (nid != 0xffff)
printk(KERN_ERR "WARNING: memory at %lx maps "
"to invalid NUMA node %d\n", start,
nid);
printk(KERN_ERR "WARNING: memory at %lx maps "
"to invalid NUMA node %d\n", start,
nid);
nid = 0;
}

Expand Down

0 comments on commit bc16a75

Please sign in to comment.