diff options
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r-- | arch/powerpc/mm/numa.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index b037d95eeadc..eaa7633515b7 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -242,10 +242,11 @@ EXPORT_SYMBOL_GPL(of_node_to_nid); | |||
242 | */ | 242 | */ |
243 | static int __init find_min_common_depth(void) | 243 | static int __init find_min_common_depth(void) |
244 | { | 244 | { |
245 | int depth; | 245 | int depth, index; |
246 | const unsigned int *ref_points; | 246 | const unsigned int *ref_points; |
247 | struct device_node *rtas_root; | 247 | struct device_node *rtas_root; |
248 | unsigned int len; | 248 | unsigned int len; |
249 | struct device_node *options; | ||
249 | 250 | ||
250 | rtas_root = of_find_node_by_path("/rtas"); | 251 | rtas_root = of_find_node_by_path("/rtas"); |
251 | 252 | ||
@@ -258,11 +259,23 @@ static int __init find_min_common_depth(void) | |||
258 | * configuration (should be all 0's) and the second is for a normal | 259 | * configuration (should be all 0's) and the second is for a normal |
259 | * NUMA configuration. | 260 | * NUMA configuration. |
260 | */ | 261 | */ |
262 | index = 1; | ||
261 | ref_points = of_get_property(rtas_root, | 263 | ref_points = of_get_property(rtas_root, |
262 | "ibm,associativity-reference-points", &len); | 264 | "ibm,associativity-reference-points", &len); |
263 | 265 | ||
266 | /* | ||
267 | * For type 1 affinity information we want the first field | ||
268 | */ | ||
269 | options = of_find_node_by_path("/options"); | ||
270 | if (options) { | ||
271 | const char *str; | ||
272 | str = of_get_property(options, "ibm,associativity-form", NULL); | ||
273 | if (str && !strcmp(str, "1")) | ||
274 | index = 0; | ||
275 | } | ||
276 | |||
264 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { | 277 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { |
265 | depth = ref_points[1]; | 278 | depth = ref_points[index]; |
266 | } else { | 279 | } else { |
267 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); | 280 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); |
268 | depth = -1; | 281 | depth = -1; |
@@ -451,7 +464,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu) | |||
451 | nid = of_node_to_nid_single(cpu); | 464 | nid = of_node_to_nid_single(cpu); |
452 | 465 | ||
453 | if (nid < 0 || !node_online(nid)) | 466 | if (nid < 0 || !node_online(nid)) |
454 | nid = any_online_node(NODE_MASK_ALL); | 467 | nid = first_online_node; |
455 | out: | 468 | out: |
456 | map_cpu_to_node(lcpu, nid); | 469 | map_cpu_to_node(lcpu, nid); |
457 | 470 | ||
@@ -1114,7 +1127,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr) | |||
1114 | int nid, found = 0; | 1127 | int nid, found = 0; |
1115 | 1128 | ||
1116 | if (!numa_enabled || (min_common_depth < 0)) | 1129 | if (!numa_enabled || (min_common_depth < 0)) |
1117 | return any_online_node(NODE_MASK_ALL); | 1130 | return first_online_node; |
1118 | 1131 | ||
1119 | memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); | 1132 | memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); |
1120 | if (memory) { | 1133 | if (memory) { |
@@ -1125,7 +1138,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr) | |||
1125 | } | 1138 | } |
1126 | 1139 | ||
1127 | if (nid < 0 || !node_online(nid)) | 1140 | if (nid < 0 || !node_online(nid)) |
1128 | nid = any_online_node(NODE_MASK_ALL); | 1141 | nid = first_online_node; |
1129 | 1142 | ||
1130 | if (NODE_DATA(nid)->node_spanned_pages) | 1143 | if (NODE_DATA(nid)->node_spanned_pages) |
1131 | return nid; | 1144 | return nid; |