linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] MIPS: SGI-IP27: Fix node_distance
@ 2020-01-09 12:23 Thomas Bogendoerfer
  2020-01-09 12:23 ` [PATCH 2/3] MIPS: Loongson64: Fix node_distance() Thomas Bogendoerfer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2020-01-09 12:23 UTC (permalink / raw)
  To: Paul Burton; +Cc: Ralf Baechle, James Hogan, linux-mips, linux-kernel

node_distance must return values starting from 10 up to 255. 10 means
local, 255 unreachable.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 arch/mips/sgi-ip27/ip27-memory.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index 563aad5e6398..a0c717662eb1 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -148,25 +148,25 @@ static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b)
 		} while ((brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)));
 	}
 
+	if (nasid_a == nasid_b)
+		return LOCAL_DISTANCE;
+
+	if (router_a == router_b)
+		return LOCAL_DISTANCE + 1;
+
 	if (router_a == NULL) {
 		pr_info("node_distance: router_a NULL\n");
-		return -1;
+		return 255;
 	}
 	if (router_b == NULL) {
 		pr_info("node_distance: router_b NULL\n");
-		return -1;
+		return 255;
 	}
 
-	if (nasid_a == nasid_b)
-		return 0;
-
-	if (router_a == router_b)
-		return 1;
-
 	router_distance = 100;
 	router_recurse(router_a, router_b, 2);
 
-	return router_distance;
+	return LOCAL_DISTANCE + router_distance;
 }
 
 static void __init init_topology_matrix(void)
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-09 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 12:23 [PATCH 1/3] MIPS: SGI-IP27: Fix node_distance Thomas Bogendoerfer
2020-01-09 12:23 ` [PATCH 2/3] MIPS: Loongson64: Fix node_distance() Thomas Bogendoerfer
2020-01-09 12:23 ` [PATCH 3/3] MIPS: mm: Place per_cpu on different nodes, if NUMA is enabled Thomas Bogendoerfer
2020-01-09 18:52 ` [PATCH 1/3] MIPS: SGI-IP27: Fix node_distance Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).