mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: al.stone@linaro.org
To: tony.luck@intel.com, fenghua.yu@intel.com, rjw@rjwysocki.net,
	catalin.marinas@arm.com, will.deacon@arm.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, lenb@kernel.org,
	robert.moore@intel.com
Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	devel@acpica.org, linaro-acpi@lists.linaro.org,
	linaro-kernel@lists.linaro.org, patches@linaro.org
Subject: [PATCH 5/7] arm64: ACPI: create arch-dependent version of acpi_osi_handler()
Date: Thu, 22 Jan 2015 17:44:42 -0700	[thread overview]
Message-ID: <1421973884-13029-6-git-send-email-al.stone@linaro.org> (raw)
In-Reply-To: <1421973884-13029-1-git-send-email-al.stone@linaro.org>

From: Al Stone <ahs3@redhat.com>

In order to deprecate the use of _OSI for arm64 or other new architectures,
we need to make the default handler something we can change for various
platforms.  This patch moves the definition of acpi_osi_handler() -- the
function used by ACPICA as a callback for evaluating _OSI -- into arch-
dependent ACPI files.  The declaration of acpi_os_handler() was moved in
a previous patch.

Previously, _OSI behaved on arm64 as it did on x86.  This patch changes
_OSI so that on arm64 it will issue a warning if invoked, and tell the
firmware that no features have been implemented (i.e., it will always
return false).

In some distant future version of ACPI where _OSI has been completely
deprecated, this implementation and all other architecture implementations
should be removed.

Signed-off-by: Al Stone <al.stone@linaro.org>
---
 arch/arm64/kernel/acpi/Makefile |  2 +-
 arch/arm64/kernel/acpi/osi.c    | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/kernel/acpi/osi.c

diff --git a/arch/arm64/kernel/acpi/Makefile b/arch/arm64/kernel/acpi/Makefile
index e049f94..15a6172 100644
--- a/arch/arm64/kernel/acpi/Makefile
+++ b/arch/arm64/kernel/acpi/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_ACPI)		+= acpi.o
+obj-$(CONFIG_ACPI)		+= acpi.o osi.o
diff --git a/arch/arm64/kernel/acpi/osi.c b/arch/arm64/kernel/acpi/osi.c
new file mode 100644
index 0000000..fa711dc
--- /dev/null
+++ b/arch/arm64/kernel/acpi/osi.c
@@ -0,0 +1,26 @@
+/*
+ *  ARM64 Specific ACPI _OSI Support
+ *
+ *  Copyright (C) 2015, Linaro Ltd.
+ *	Author: Al Stone <al.stone@linaro.org>
+ *
+ *  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 <linux/acpi.h>
+
+/*
+ * 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;
+}
+
-- 
2.1.0


  parent reply	other threads:[~2015-01-23  0:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  0:44 [PATCH 0/7] Start deprecating _OSI on new architectures al.stone
2015-01-23  0:44 ` [PATCH 1/7] ia64: ACPI: move kernel acpi files to a directory al.stone
2015-01-23  0:49   ` Al Stone
2015-01-23  0:44 ` [PATCH 2/7] arm64: " al.stone
2015-01-23  0:44 ` [PATCH 3/7] x86: ACPI: create arch-dependent version of acpi_osi_handler() al.stone
2015-01-23  0:44 ` [PATCH 4/7] ia64: " al.stone
2015-01-23  0:44 ` al.stone [this message]
2015-01-23  0:44 ` [PATCH 6/7] x86: ia64: arm64: ACPI: move _OSI support functions to arch-dependent locations al.stone
2015-01-23  0:44 ` [PATCH 7/7] ACPI: use Linux as ACPI_OS_NAME for _OS on ARM64 al.stone
2015-01-23 15:55   ` Rafael J. Wysocki
2015-01-23 16:34     ` Al Stone
2015-01-23 15:43 ` [PATCH 0/7] Start deprecating _OSI on new architectures Rafael J. Wysocki
2015-01-23 16:32   ` Al Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421973884-13029-6-git-send-email-al.stone@linaro.org \
    --to=al.stone@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=devel@acpica.org \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patches@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®