From patchwork Tue May 24 22:35:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9134399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84697607D3 for ; Tue, 24 May 2016 22:40:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79465281E3 for ; Tue, 24 May 2016 22:40:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DF302822B; Tue, 24 May 2016 22:40:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1199281E3 for ; Tue, 24 May 2016 22:40:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b5Kwy-0007Ie-SV; Tue, 24 May 2016 22:37:20 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b5Kw7-0006ni-9h for linux-arm-kernel@lists.infradead.org; Tue, 24 May 2016 22:36:28 +0000 Received: by mail-pf0-x242.google.com with SMTP id b124so2929438pfb.0 for ; Tue, 24 May 2016 15:36:09 -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=zM2MBzQgSa8qdts+oNIJV3pKdg58h2zLMU72xECFxZo=; b=Ae26wRu21AElhJvn95RDbAvFXrJ4gZkPj/byNel4LPNI9PBVqLI2v70zm1j47hJglk hUfXqSRUetezRIll02wnUhOGVo0FFZFx/1dT5xYX5+lKngNMldHLvS5HHc/sZm63tDuQ B7MJYqKMbHKJZFHkq4QSjJmZ6UfAqQk7kq5I5Yejtso2+7VfNffoSSgvucwIMw2JnRAD j4CYJPus9dPYhhM3/k4LwiDjBM/WcToUV0IvzDOswD1YU5m4jCs+Lhi2oavlOQCjS3OX 6K7/9n6OFZ+pxvrYLIphf5/4GZM8SAttbZmDQ56AoAIy+TzpC9Sc/CBA4INYuqqUsXGC HcWA== 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=zM2MBzQgSa8qdts+oNIJV3pKdg58h2zLMU72xECFxZo=; b=l7zG0ZunnKS8eJx/CI9tSf0N3zZliWjgV8jQ2F0dQvRm0WIDcDRLUKUDQMa8ZLWO/F hGF8ZdGiFAFk52zAzZf6LyX1FhCDqVJ1o9FMMj3GHTCwTP8SEvEwH2lA6uO3lz6v2v8o aB1x+L0VFwjm7fvc1zrXX30+RPq3LH6WYIPzQ/M7ydH2Vi7Pb6gHnO2wTHZKA7bR3Wek 9s97283k+Yyb5hx3+dgzYgcYzFTDBOTMbQoMzVDwt2ql0PUz7u6tCAZQ9GLMGasX1X4A 5md95hKt41eW22eL7rQfbhMfmuwANw73fLfwE1rM693QD77igLxidZUrz3Zax92sORQM Un4w== X-Gm-Message-State: ALyK8tI4aCqzbXCc7npFIjhY4Y5Ba48APzYvuFhJB8GaNTKle5ofA8rYFfd3jMJUFbmKMw== X-Received: by 10.98.74.10 with SMTP id x10mr860109pfa.3.1464129368690; Tue, 24 May 2016 15:36:08 -0700 (PDT) Received: from dl.caveonetworks.com ([50.233.148.158]) by smtp.gmail.com with ESMTPSA id q129sm56717382pfb.16.2016.05.24.15.36.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 May 2016 15:36:02 -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 u4OMZxWW019055; Tue, 24 May 2016 15:35:59 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u4OMZxdp019054; Tue, 24 May 2016 15:35:59 -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 Subject: [PATCH v7 05/15] acpi, numa: move acpi_numa_slit_init() to drivers/acpi/numa.c Date: Tue, 24 May 2016 15:35:35 -0700 Message-Id: <1464129345-18985-6-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1464129345-18985-1-git-send-email-ddaney.cavm@gmail.com> References: <1464129345-18985-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160524_153627_451789_83B09DBB X-CRM114-Status: GOOD ( 16.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 fb2c0d6..7e0649d 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;