diff mbox series

[1/3] MIPS: SGI-IP27: Fix node_distance

Message ID 20200109122331.4109-1-tbogendoerfer@suse.de (mailing list archive)
State Mainlined
Commit a20ebc047a4a300b19df79116598c8c0bd0a9d1e
Delegated to: Paul Burton
Headers show
Series [1/3] MIPS: SGI-IP27: Fix node_distance | expand

Commit Message

Thomas Bogendoerfer Jan. 9, 2020, 12:23 p.m. UTC
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(-)

Comments

Paul Burton Jan. 9, 2020, 6:52 p.m. UTC | #1
Hello,

Thomas Bogendoerfer wrote:
> node_distance must return values starting from 10 up to 255. 10 means
> local, 255 unreachable.

Series applied to mips-next.

> MIPS: SGI-IP27: Fix node_distance
>   commit a20ebc047a4a
>   https://git.kernel.org/mips/c/a20ebc047a4a
>   
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>
> 
> MIPS: Loongson64: Fix node_distance()
>   commit a14879e149c9
>   https://git.kernel.org/mips/c/a14879e149c9
>   
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>
> 
> MIPS: mm: Place per_cpu on different nodes, if NUMA is enabled
>   commit f3c560a61b4e
>   https://git.kernel.org/mips/c/f3c560a61b4e
>   
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]
diff mbox series

Patch

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)