summaryrefslogtreecommitdiff
path: root/arch/x86/platform/efi/quirks.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-06-13 12:39:55 +0100
committerMatt Fleming <matt.fleming@intel.com>2014-07-18 21:23:52 +0100
commit44be28e9dd9880dca3e2cbf7a844f2114e67f2cb (patch)
tree8f0ed71cd35b242fc546ccdd9da58f7c0f6363a2 /arch/x86/platform/efi/quirks.c
parent0c5ed61adbdbf2ca5de934642d5be1e971c498c1 (diff)
x86/reboot: Add EFI reboot quirk for ACPI Hardware Reduced flag
It appears that the BayTrail-T class of hardware requires EFI in order to powerdown and reboot and no other reliable method exists. This quirk is generally applicable to all hardware that has the ACPI Hardware Reduced bit set, since usually ACPI would be the preferred method. Cc: Len Brown <len.brown@intel.com> Cc: Mark Salter <msalter@redhat.com> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/platform/efi/quirks.c')
-rw-r--r--arch/x86/platform/efi/quirks.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index b4cb9182f155..1c7380da65ff 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -7,6 +7,7 @@
#include <linux/slab.h>
#include <linux/memblock.h>
#include <linux/bootmem.h>
+#include <linux/acpi.h>
#include <asm/efi.h>
#include <asm/uv/uv.h>
@@ -265,3 +266,25 @@ void __init efi_apply_memmap_quirks(void)
if (is_uv_system())
set_bit(EFI_OLD_MEMMAP, &efi.flags);
}
+
+/*
+ * For most modern platforms the preferred method of powering off is via
+ * ACPI. However, there are some that are known to require the use of
+ * EFI runtime services and for which ACPI does not work at all.
+ *
+ * Using EFI is a last resort, to be used only if no other option
+ * exists.
+ */
+bool efi_reboot_required(void)
+{
+ if (!acpi_gbl_reduced_hardware)
+ return false;
+
+ efi_reboot_quirk_mode = EFI_RESET_WARM;
+ return true;
+}
+
+bool efi_poweroff_required(void)
+{
+ return !!acpi_gbl_reduced_hardware;
+}