From patchwork Wed Apr 20 01:40:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8884741 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 812309F39A for ; Wed, 20 Apr 2016 01:42:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9C5E2026F for ; Wed, 20 Apr 2016 01:42:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88848202E5 for ; Wed, 20 Apr 2016 01:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932665AbcDTBlB (ORCPT ); Tue, 19 Apr 2016 21:41:01 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34636 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932565AbcDTBkx (ORCPT ); Tue, 19 Apr 2016 21:40:53 -0400 Received: by mail-pf0-f171.google.com with SMTP id c20so12419078pfc.1; Tue, 19 Apr 2016 18:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=itgovvCRw9rPrJDFRdVyEd4k/nsyKnKxEKBxS7AYKeE=; b=rSg6+eHXTPIy6Sy6vyN6XSeOV3L6DZ8HgHoPCERsVHpVCmhdARvMueqFpb0HJhh9Zu DWKpobu50lTr4KPjeuQhZ9saE6NVhnsDrleR/0ih4NOJFLQyqBaTdQH8tj61pu4h66eX t2CSkSkdXm768jtQqXr/IFhPPwZaqRhSgmZAqZpIRHt/xUclCSpVPYkhWMVPsfPtKK1v 637xeccm/RjRruEhBOFmxddkXmG9f3fnMD61oovzl57YuMV244V0Yi47pKNTGnkEGTOv +etwDAfF3FGJJyZ/rIwBO5zzRxsDHfqWhbj74lL6VxlP7ZkGuJMBlfjN34Lr/xCmSeSB YSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=itgovvCRw9rPrJDFRdVyEd4k/nsyKnKxEKBxS7AYKeE=; b=YcLtY1EjpKnC6X+HuWyqRGA6ICUAKwtwgI7odpHuU6KvutHOYD1o5J/tbwTcJepi3q IFFRV16x7+2QI1bpb14gZ+TWUsMq9JEw8+qXVUr82xKbHANkkqNS4VKe5zly0nwUWzOb 8WgOVuS6YVSLTyNqYSTiw4HGPlHDs70ZdXab1TRIEwZ0fvyindxrM4DCJ3i1Nc8jELqe CLQbYmHE+090l83tnxc+slwxK3s3lPqwRDPfaR84hMmqfdv0iJl3MCinyuVm+sg/Xu5a UqpFi5e8oIs/H/VynWVkJ3qZDd60TN8uDLJ9wuO+aUgOorKBq9L5ehWIG47NQ9+5rabK QIVQ== X-Gm-Message-State: AOPr4FVz8eRJIgT8qTgcSr/JzDjGB1xutqzPQ4q9H1KHmX8UXYXX7N9yKwOZ1mtz/8MDTw== X-Received: by 10.98.69.75 with SMTP id s72mr8597274pfa.66.1461116452612; Tue, 19 Apr 2016 18:40:52 -0700 (PDT) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id zu10sm93934797pab.31.2016.04.19.18.40.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Apr 2016 18:40:47 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u3K1ekb7023058; Tue, 19 Apr 2016 18:40:46 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u3K1ejfw023057; Tue, 19 Apr 2016 18:40:45 -0700 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Rutland , Catalin Marinas , Tony Luck , Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , Grant Likely , Robert Moore , Lv Zheng , Hanjun Guo , Marc Zyngier , linux-ia64@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org Cc: linux-kernel@vger.kernel.org, Robert Richter , David Daney Subject: [PATCH v5 05/14] acpi, numa: move acpi_numa_slit_init() to drivers/acpi/numa.c Date: Tue, 19 Apr 2016 18:40:30 -0700 Message-Id: <1461116439-22991-6-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1461116439-22991-1-git-send-email-ddaney.cavm@gmail.com> References: <1461116439-22991-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hanjun Guo Identical implementations of acpi_numa_slit_init() are used by both x86 and follow-on arm64 support. Move it to drivers/acpi/numa.c, and guard with CONFIG_X86 || CONFIG_ARM64 because ia64 has its own architecture specific implementation. No code change. Signed-off-by: Hanjun Guo Signed-off-by: Robert Richter Signed-off-by: David Daney --- arch/x86/mm/srat.c | 27 --------------------------- drivers/acpi/numa.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 90b6ed9..f242a11 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -42,33 +42,6 @@ static __init inline int srat_disabled(void) return acpi_numa < 0; } -/* - * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for - * I/O localities since SRAT does not list them. I/O localities are - * not supported at this point. - */ -void __init acpi_numa_slit_init(struct acpi_table_slit *slit) -{ - int i, j; - - for (i = 0; i < slit->locality_count; i++) { - const int from_node = pxm_to_node(i); - - if (from_node == NUMA_NO_NODE) - continue; - - for (j = 0; j < slit->locality_count; j++) { - const int to_node = pxm_to_node(j); - - if (to_node == NUMA_NO_NODE) - continue; - - numa_set_distance(from_node, to_node, - slit->entry[slit->locality_count * i + j]); - } - } -} - /* Callback for Proximity Domain -> x2APIC mapping */ void __init acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index f41f06b..acc361d 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -197,6 +197,35 @@ static int __init slit_valid(struct acpi_table_slit *slit) return 1; } +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) +/* + * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for + * I/O localities since SRAT does not list them. I/O localities are + * not supported at this point. + */ +void __init acpi_numa_slit_init(struct acpi_table_slit *slit) +{ + int i, j; + + for (i = 0; i < slit->locality_count; i++) { + const int from_node = pxm_to_node(i); + + if (from_node == NUMA_NO_NODE) + continue; + + for (j = 0; j < slit->locality_count; j++) { + const int to_node = pxm_to_node(j); + + if (to_node == NUMA_NO_NODE) + continue; + + numa_set_distance(from_node, to_node, + slit->entry[slit->locality_count * i + j]); + } + } +} +#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ + static int __init acpi_parse_slit(struct acpi_table_header *table) { struct acpi_table_slit *slit = (struct acpi_table_slit *)table;