From patchwork Wed Feb 4 00:21:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 44318 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4DC521513 for ; Wed, 4 Feb 2015 00:22:08 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf162955wid.3 for ; Tue, 03 Feb 2015 16:22:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vBZQ3+kBlAiOm3oOqM9VRn2Cfz30ImO5iIzeHMpkiFQ=; b=XUCnup87GvZK34dfAjUFHbrfDw0/GrmIg5J/VnTnaBBylDdfQ7nR9YMpq7yP4ulZV6 tzET4KSln8u0sxxVoRchQh7/3roNCyvsErB0a4PGbnNat2MvFQ091Flg3sOBrFYDPkz9 bSLLcyml/j92rx3/EihTXD5xw7+hwY1SwjQDYebsnFL4aeJvm4C2MQV6znoVrOx8dZyF Qz1fZtBdqfks49JFKT/ZjuRfnbMTbzyu4+ZWRpahSxb14NApGiBKF8lypOTjFQKotiL7 AjbIb80J8uTHKjkZluGiai8pxvM7YJ+y06kWmzLw/hXeGHH2GMfm6+ZTTSzmAG7LaUwa YOTw== X-Gm-Message-State: ALoCoQlX2AHpVZ4e78hVdFyEUO+wuKyxgf+GYtfWTIrnvrPNbgMF5iveZuac8EH5I5Xyua44KKC1 X-Received: by 10.113.5.167 with SMTP id cn7mr1134618lbd.21.1423009327934; Tue, 03 Feb 2015 16:22:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.2 with SMTP id bc2ls261966lab.13.gmail; Tue, 03 Feb 2015 16:22:07 -0800 (PST) X-Received: by 10.152.9.41 with SMTP id w9mr27243513laa.17.1423009327726; Tue, 03 Feb 2015 16:22:07 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id xv1si65107lab.61.2015.02.03.16.22.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 16:22:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id pn19so9320370lab.2 for ; Tue, 03 Feb 2015 16:22:07 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr27213476lbc.56.1423009327599; Tue, 03 Feb 2015 16:22:07 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp166714lbj; Tue, 3 Feb 2015 16:22:06 -0800 (PST) X-Received: by 10.50.62.110 with SMTP id x14mr21510982igr.2.1423009323846; Tue, 03 Feb 2015 16:22:03 -0800 (PST) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com. [209.85.213.179]) by mx.google.com with ESMTPS id a70si116993ioa.0.2015.02.03.16.22.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Feb 2015 16:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.213.179 as permitted sender) client-ip=209.85.213.179; Received: by mail-ig0-f179.google.com with SMTP id l13so419074iga.0 for ; Tue, 03 Feb 2015 16:22:03 -0800 (PST) X-Received: by 10.43.92.9 with SMTP id bo9mr27377694icc.54.1423009323077; Tue, 03 Feb 2015 16:22:03 -0800 (PST) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by mx.google.com with ESMTPSA id d39sm73966ioj.26.2015.02.03.16.22.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Feb 2015 16:22:02 -0800 (PST) From: al.stone@linaro.org To: rjw@rjwysocki.net, lenb@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, robert.moore@intel.com, tony.luck@intel.com, fenghua.yu@intel.com Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-arm-kernel@lists.infradead.org, linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org Subject: [PATCH v2 3/5] ACPI: add arch-specific compilation for _OSI and the blacklist Date: Tue, 3 Feb 2015 17:21:42 -0700 Message-Id: <1423009304-5007-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423009304-5007-1-git-send-email-al.stone@linaro.org> References: <1423009304-5007-1-git-send-email-al.stone@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Al Stone Now that all of the _OSI functionality has been separated out, we can provide arch-specific functionality for it. This also allows us to do the same for the acpi_blacklisted() function. Whether arch-specific functions are used or not now depends on the config options CONFIG_ACPI_ARCH_SPECIFIC_OSI and CONFIG_ARCH_SPECIFIC_BLACKLIST. By default, both are set false which causes the x86/ia64 versions to be used, just as is done today. Setting one or both of these options true will cause architecture-specific implementations to be built instead; this patch also provides arm64 implementations. For x86/ia64, there is no functional change. For arm64, any use of _OSI will issue a warning that it is deprecated. All use of _OSI will return false -- i.e., it will return no useful information to any firmware using it. The ability to temporarily turn on _OSI, or turn off _OSI, or affect it in other ways from the command line is no longer available for arm64, either. The blacklist for ACPI on arm64 is empty. This will, of course, require ACPI to be enabled for arm64. Signed-off-by: Al Stone --- drivers/acpi/Kconfig | 22 ++++++++++++++++++++++ drivers/acpi/Makefile | 19 ++++++++++++++++++- drivers/acpi/blacklist-arm.c | 20 ++++++++++++++++++++ drivers/acpi/blacklist.c | 5 +++++ drivers/acpi/osi-arm.c | 25 +++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 drivers/acpi/blacklist-arm.c create mode 100644 drivers/acpi/osi-arm.c diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 3e3bd35..4190940 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -369,6 +369,28 @@ config ACPI_REDUCED_HARDWARE_ONLY If you are unsure what to do, do not enable this option. +config ACPI_ARCH_SPECIFIC_OSI + bool "Use an arch-specific _OSI implementation" if EXPERT + def_bool n + help + If this option is set, the ACPI driver will use an + implementation of _OSI that is specific to the target + architecture, instead of the default implementation + originally created for x86 and then used on ia64. + + If you are unsure what to do, do not enable this option. + +config ACPI_ARCH_SPECIFIC_BLACKLIST + bool "Use an arch-specific ACPI blacklist" if EXPERT + def_bool n + help + If this option is set, the ACPI driver will use a blacklist + that is specific to the target architecture, instead of the + default implementation originally created for x86 and then + used on ia64. + + If you are unsure what to do, do not enable this option. + source "drivers/acpi/apei/Kconfig" config ACPI_EXTLOG diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index df348b3..beefb17 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -18,9 +18,26 @@ obj-y += acpi.o \ acpica/ # All the builtin files are in the "acpi." module_param namespace. -acpi-y += osl.o utils.o reboot.o osi.o +acpi-y += osl.o utils.o reboot.o acpi-y += nvs.o +# _OSI related files +ifeq ($(CONFIG_ACPI_ARCH_SPECIFIC_OSI), y) +ifeq ($(ARCH), arm64) +acpi-y += osi-arm.o +endif +else # X86, IA64 +acpi-y += osi.o +endif + +ifeq ($(CONFIG_ACPI_ARCH_SPECIFIC_BLACKLIST), y) +ifeq ($(ARCH), arm64) +acpi-y += blacklist-arm.o +endif +else # X86, IA64 +acpi-y += blacklist.o +endif + # Power management related files acpi-y += wakeup.o ifeq ($(ARCH), arm64) diff --git a/drivers/acpi/blacklist-arm.c b/drivers/acpi/blacklist-arm.c new file mode 100644 index 0000000..1be6a56 --- /dev/null +++ b/drivers/acpi/blacklist-arm.c @@ -0,0 +1,20 @@ +/* + * ARM64 Specific ACPI Blacklist Support + * + * Copyright (C) 2015, Linaro Ltd. + * Author: Al Stone + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#define pr_fmt(fmt) "ACPI: " fmt + +#include + +/* The arm64 ACPI blacklist is currently empty. */ +int __init acpi_blacklisted(void) +{ + return 0; +} diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 3931e19..222c82d 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c @@ -34,9 +34,14 @@ #include "internal.h" +#ifdef CONFIG_ACPI_ARCH_SPECIFIC_OSI +void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) { } +void __init acpi_osi_setup(char *str) { } +#else extern void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); extern void __init acpi_osi_setup(char *str); +#endif enum acpi_blacklist_predicates { all_versions, diff --git a/drivers/acpi/osi-arm.c b/drivers/acpi/osi-arm.c new file mode 100644 index 0000000..bb351f4 --- /dev/null +++ b/drivers/acpi/osi-arm.c @@ -0,0 +1,25 @@ +/* + * ARM64 Specific ACPI _OSI Support + * + * Copyright (C) 2015, Linaro Ltd. + * Author: Al Stone + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#define pr_fmt(fmt) "ACPI: " fmt + +#include + +/* + * Consensus is to deprecate _OSI for all new ACPI-supported architectures. + * So, for arm64, reduce _OSI to a warning message, and tell the firmware + * nothing of value. + */ +u32 acpi_osi_handler(acpi_string interface, u32 supported) +{ + pr_warn("_OSI was called, but is deprecated for this architecture.\n"); + return false; +}