Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2101581ybl; Thu, 9 Jan 2020 06:58:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyHU6lwnORmDVA/D+z+pv0KPSoT/v2hlxKMI4sLgrhSo7O3jdKjgpAbbqu21gG8MVGdlt+z X-Received: by 2002:aca:d502:: with SMTP id m2mr3240284oig.41.1578581905020; Thu, 09 Jan 2020 06:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578581905; cv=none; d=google.com; s=arc-20160816; b=nOWQOvpy2E3OD0LB5J84FpSryPrjq7vldip++b6U3qSgZpTzEocGopCmOBaSXTBtdI RTa5n64lbR7akFWvpWVp5/z4I56AfRXKrInIe76GFoyMaH9o1rXmiw8nTrGVwNOKzYgx RfzFiqptldG0X5Qj/pU5CMhd9HjxDo5d5ic9I7geQHfGt3Q8NLN4M2uGdlanSEWzbSXs FXiPnZ24kJ5BIvDz0/6+UPymstgexRE8wAh/k9qUGCICaYhOhLbwyA44t7ybgn6u98Yi i0psumK4Z5n4w5PSYvGECr0bcENtYlo+VT4HBJNo9HDjimvJPQQs+y+61KnkY1Vivgyq FM9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=piLKJAGtJRj7AzzGTPMIE3PkpY4qQA5Jb/HjKEQZnLc=; b=ykhoSk/MxGb/1AEYCtWy3zc6uBmdiGcIf6B7jVUjaFn4d9b4Z7IutOB+gxjAVU4XmL IPx4orNihhQtp4VKwKc7Sb377CiCp6NcRJdK4xQBfrJtldzA2a913N1uYh6LxXiuRqBy cS4hM+iw4ik9Wrqkad4KlIgDkhHfgHn4qOdkCt+31AOV16MO+PVkMiOtSeAox31uYiAO NUI90KZXkGv6TNj6vLerIMVY5ir/X+/PoaxxEiZmF+Q+5Sb0dDBZd+2dSZIT5h0DuQwt Wq9YTjKe0u4kEjFLn2HGwNTLCeLhTOwQafN8bdqbaun4dOF/LC6tMGcTdrRZBvuhCFr8 jiXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si3624055oic.222.2020.01.09.06.58.12; Thu, 09 Jan 2020 06:58:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730889AbgAIMXt (ORCPT + 99 others); Thu, 9 Jan 2020 07:23:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:35272 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729266AbgAIMXt (ORCPT ); Thu, 9 Jan 2020 07:23:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9BD19B2180; Thu, 9 Jan 2020 12:23:44 +0000 (UTC) From: Thomas Bogendoerfer To: Paul Burton Cc: Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] MIPS: SGI-IP27: Fix node_distance Date: Thu, 9 Jan 2020 13:23:29 +0100 Message-Id: <20200109122331.4109-1-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org node_distance must return values starting from 10 up to 255. 10 means local, 255 unreachable. Signed-off-by: Thomas Bogendoerfer --- 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