aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 64c00227b997..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 */
243static int __init find_min_common_depth(void) 243static 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;