From patchwork Mon Apr 18 21:14:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 66060 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1503465qge; Mon, 18 Apr 2016 14:16:57 -0700 (PDT) X-Received: by 10.66.141.76 with SMTP id rm12mr53519001pab.30.1461014213062; Mon, 18 Apr 2016 14:16:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si1888890paa.115.2016.04.18.14.16.52; Mon, 18 Apr 2016 14:16:53 -0700 (PDT) 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; dkim=pass header.i=@gmail.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; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbcDRVQu (ORCPT + 29 others); Mon, 18 Apr 2016 17:16:50 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36797 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcDRVOg (ORCPT ); Mon, 18 Apr 2016 17:14:36 -0400 Received: by mail-pa0-f41.google.com with SMTP id er2so53997189pad.3; Mon, 18 Apr 2016 14:14:36 -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=lGDLx42Iwronb5UyDgVF7PvFl9T6qDzGElj6JQiIMqQ=; b=utVZ83qylRDJ+aJx+4U4OxL1dHofFNExbuVIgAIBTFmgeN7lzU3YOD7V8bZ6JgEytH Im3ykEuu3EH5zXvP3/peSQP7fXgaMyi5LcncY0IpuwisipeROz3gLX9efyw0MT6Zo4Es o9BJODTDqxWbxNP7qKNeW+NR88XCalaPf/tbPkQ7p759ruoi3LQ0sTTcURCvPof+pZ2Y 1ptSf3ViFoNsVi0dD9uaS4M0Uq1Ir7lgnvfT9F7UFEwfLrQgVcHaaMnGPsTtl6p7Ob6s BeboVCj2uArRPlEAMpPa+6WiOWxgMvBsdB1busIzEYVtSa5JcWioRgbn+8AEntHVx9x6 9Y/g== 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=lGDLx42Iwronb5UyDgVF7PvFl9T6qDzGElj6JQiIMqQ=; b=mNE2V3ZqtCRc3LfJfuRC1uA5ckkO76RJm/TmBFGO8dtuw/G+UFn1EKStQZaCTg/dys DjkQgHnkt9zVvfScC+ykrq7NRzG9jr2J8wd4pFhMb4uBH+/SXJJ2JHAqSmjR30ZzywqS vidOKW5VY5l6ZK06TtBL3I+aEmQvMsi34o2hcgwDwUoFKtG9rKA+i/Dz7Nax/zuQlsj6 f9EOWfDkswaWGIuzE0u3OrOkq9FHGdC1ogmrTgZefr7SHDAuzF3JomZhq23+PNsTmJb2 gxg0VobpOsJBgpSF31uSullrGDuYKGqIKuhhIgjT+liXy68m+c1LPvpDygdkHG8yPGk1 T51Q== X-Gm-Message-State: AOPr4FVMWO91PMpjd+gBBlYARoH3Dde3R/v3B67J4TdAAxGJ5E0IdtMhf0NngvZ3u1nzhQ== X-Received: by 10.66.40.236 with SMTP id a12mr52919157pal.58.1461014075878; Mon, 18 Apr 2016 14:14:35 -0700 (PDT) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id m22sm6586706pfi.79.2016.04.18.14.14.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Apr 2016 14:14:30 -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 u3ILERXQ030869; Mon, 18 Apr 2016 14:14:27 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u3ILERLK030868; Mon, 18 Apr 2016 14:14:27 -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 v4 08/14] acpi, numa: move bad_srat() and srat_disabled() to drivers/acpi/numa.c Date: Mon, 18 Apr 2016 14:14:06 -0700 Message-Id: <1461014052-30788-9-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1461014052-30788-1-git-send-email-ddaney.cavm@gmail.com> References: <1461014052-30788-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 | 1 + include/acpi/acpi_numa.h | 12 ++++++++++++ 5 files changed, 14 insertions(+), 15 deletions(-) -- 1.7.11.7 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 5403d62..9b35ba9 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) { diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 94a37cd..28f06a6 100644 --- a/include/acpi/acpi_numa.h +++ b/include/acpi/acpi_numa.h @@ -15,6 +15,18 @@ 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; + +static inline void bad_srat(void) +{ + pr_err("SRAT: SRAT not used.\n"); + acpi_numa = -1; +} + +static inline int srat_disabled(void) +{ + return acpi_numa < 0; +} #endif /* CONFIG_ACPI_NUMA */ #endif /* __ACP_NUMA_H */