From patchwork Wed Apr 20 01:40:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8884771 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67418BF29F for ; Wed, 20 Apr 2016 01:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48D0F202C8 for ; Wed, 20 Apr 2016 01:42:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4230D2024F for ; Wed, 20 Apr 2016 01:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647AbcDTBmg (ORCPT ); Tue, 19 Apr 2016 21:42:36 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33440 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932663AbcDTBlB (ORCPT ); Tue, 19 Apr 2016 21:41:01 -0400 Received: by mail-pf0-f173.google.com with SMTP id 184so12566103pff.0; Tue, 19 Apr 2016 18:41:00 -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=vz1I945XmxvJtWi72SRBicKu4tJtz6BjvbJopONtUko=; b=L0PbHvvAmARRl2RBSjYl8Ess0oqhyu38Eq94eFVr1ZvhJb/bMzIgSQc1NjfgN1e1Ai VLx10rsUSUXLm9OUmNejHu122wKgeeE818zsI/SLTNDcQxatJfKicUWY6D/CER5ukZeW A6o9pT1yYSxGPYFNKToK7PVa8EfmMFWId1Qm+eTOuHITJ72BOM2j871JynKwYaLqp+yz wgvQwCy0xTjVfuwW24Cj4Q0PzF2kP3vzQ2kc1AzcsIOHfLpOnlUroWR6VASGbXaPh7UO vvnwDD9NJ1T1HwvAP4fkqqWDqjpRL/mOEL/l0OjkydbdQb7dwuxIa+MnAnviU9pTVx+3 Yofg== 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=vz1I945XmxvJtWi72SRBicKu4tJtz6BjvbJopONtUko=; b=khg4EfYpTXbupANsBUzizbzJmHsaXOLQyuJ+A6d6UTJCAXqy+ogYumplJFyv9kjfCY LkK9falMjLhx7pRquwlNRvsGWSk5mOKwlMvd1jsOKEuPNDNRnPqG7a9Zxhqs+HwUxcOm KrkjT0K1b9F6qPJbz6K79UVVyNmq5er1xTd6UYpmJWqQrzijoTkw6VYjJfKVOcWlbM3Z pdqGLuyMaCon5Ok8LtN/POOzSrOvBfV7swtmV7kjfkbDi5ErcBkhWj8xpLZNyRu8kGn2 Wjv2E0xeetK0Tzt1WAxbteWSpFpndS09Uwu9LfxZezwBcs/itljTKvF242HNCcwZqv8B 8W1A== X-Gm-Message-State: AOPr4FWrWx1OYKq6+pVOHABzsZoDoIFyaWBPB0bv8uWxFQBz3heq2WJhyia7um/R1LseOw== X-Received: by 10.98.66.146 with SMTP id h18mr8492419pfd.27.1461116460161; Tue, 19 Apr 2016 18:41:00 -0700 (PDT) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id 17sm93627615pfp.96.2016.04.19.18.40.48 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Apr 2016 18:40:52 -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 u3K1el8m023071; Tue, 19 Apr 2016 18:40:47 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u3K1el5E023070; Tue, 19 Apr 2016 18:40:47 -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 08/14] acpi, numa: move bad_srat() and srat_disabled() to drivers/acpi/numa.c Date: Tue, 19 Apr 2016 18:40:33 -0700 Message-Id: <1461116439-22991-9-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 bad_srat() and srat_disabled() are shared by x86 and follow-on arm64 patches. Move them to drivers/acpi/numa.c in preparation for arm64 support. Signed-off-by: Hanjun Guo Signed-off-by: Robert Richter [david.daney@cavium.com moved definitions to drivers/acpi/numa.c] Signed-off-by: David Daney --- arch/x86/include/asm/acpi.h | 1 - arch/x86/mm/numa.c | 2 +- arch/x86/mm/srat.c | 13 ------------- drivers/acpi/numa.c | 12 ++++++++++++ include/acpi/acpi_numa.h | 4 ++++ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 94c18eb..65f1e95 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h @@ -145,7 +145,6 @@ static inline void disable_acpi(void) { } #define ARCH_HAS_POWER_INIT 1 #ifdef CONFIG_ACPI_NUMA -extern int acpi_numa; extern int x86_acpi_numa_init(void); #endif /* CONFIG_ACPI_NUMA */ diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index f70c1ff..57673f5 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -1,4 +1,5 @@ /* Common code for 32 and 64-bit NUMA */ +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include #include #include "numa_internal.h" diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 9e2a833..4217071f 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -24,19 +24,6 @@ #include #include -int acpi_numa __initdata; - -static __init void bad_srat(void) -{ - printk(KERN_ERR "SRAT: SRAT not used.\n"); - acpi_numa = -1; -} - -static __init inline int srat_disabled(void) -{ - return acpi_numa < 0; -} - /* 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 acc361d..7174a38 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -40,6 +40,7 @@ static int node_to_pxm_map[MAX_NUMNODES] = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; unsigned char acpi_srat_revision __initdata; +int acpi_numa __initdata; int pxm_to_node(int pxm) { @@ -197,6 +198,17 @@ static int __init slit_valid(struct acpi_table_slit *slit) return 1; } +void __init bad_srat(void) +{ + pr_err("SRAT: SRAT not used.\n"); + acpi_numa = -1; +} + +int __init srat_disabled(void) +{ + return acpi_numa < 0; +} + #if defined(CONFIG_X86) || defined(CONFIG_ARM64) /* * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 94a37cd..d4b7294 100644 --- a/include/acpi/acpi_numa.h +++ b/include/acpi/acpi_numa.h @@ -15,6 +15,10 @@ extern int pxm_to_node(int); extern int node_to_pxm(int); extern int acpi_map_pxm_to_node(int); extern unsigned char acpi_srat_revision; +extern int acpi_numa __initdata; + +extern void bad_srat(void); +extern int srat_disabled(void); #endif /* CONFIG_ACPI_NUMA */ #endif /* __ACP_NUMA_H */