ACPI currently accesses resources it should not when cores=1 and Hardware Reduced is set in FACP

Bug #1222861 reported by Graeme Gregory
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linaro-acpi
Won't Fix
Medium
hanjun.guo

Bug Description

When FACP Hardware Reduced flag is set ACPI drivers should not be accessing power management registers directly.

This bug only seems to trigger on arm when booting with a single core.

This produces an Ooops similar to

    [ 37.822312] [<80229bb2>] (acpi_os_read_port+0x22/0x42) from [<80239dff>] (acpi_hw_read_port+0x2b/0x6c)
    [ 37.822549] [<80239dff>] (acpi_hw_read_port+0x2b/0x6c) from [<8023988b>] (acpi_hw_read+0x37/0x3a)
    [ 37.822784] [<8023988b>] (acpi_hw_read+0x37/0x3a) from [<802398a9>] (acpi_hw_read_multiple+0x1b/0x48)
    [ 37.823025] [<802398a9>] (acpi_hw_read_multiple+0x1b/0x48) from [<802399dd>] (acpi_hw_register_read+0x35/0xb0)
    [ 37.823271] [<802399dd>] (acpi_hw_register_read+0x35/0xb0) from [<80239eff>] (acpi_write_bit_register+0x29/0x76)
    [ 37.823503] [<80239eff>] (acpi_write_bit_register+0x29/0x76) from [<80232913>] (acpi_ev_initialize_events+0x37/0x88)
    [ 37.823719] [<80232913>] (acpi_ev_initialize_events+0x37/0x88) from [<80243da9>] (acpi_enable_subsystem+0x4d/0x70)
    [ 37.823936] [<80243da9>] (acpi_enable_subsystem+0x4d/0x70) from [<804876dd>] (acpi_init+0x3d/0x1e8)
    [ 37.824142] [<804876dd>] (acpi_init+0x3d/0x1e8) from [<80008687>] (do_one_initcall+0x2f/0x114)
    [ 37.824368] [<80008687>] (do_one_initcall+0x2f/0x114) from [<8046d92b>] (kernel_init_freeable+0xcb/0x15c)
    [ 37.824596] [<8046d92b>] (kernel_init_freeable+0xcb/0x15c) from [<802f4475>] (kernel_init+0xd/0xa0)
    [ 37.824805] [<802f4475>] (kernel_init+0xd/0xa0) from [<8000ccbd>] (ret_from_fork+0x11/0x20)

summary: - ACPI currently accesses resources it should not what cores=1 and
+ ACPI currently accesses resources it should not when cores=1 and
Hardware Reduced is set in FACP
hanjun.guo (hanjun-guo)
Changed in linaro-acpi:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → hanjun.guo (hanjun-guo)
Revision history for this message
hanjun.guo (hanjun-guo) wrote :

after a long discussion with Robert Moore and Lv Zheng form intel (they are ACPICA maintainer), they agreed to introduce a kernel config for the ACPI_HARDWARE_REDUCED macro, some thing like:

From b10bc1d2f9a3ff09abfb6990412aa1cf62d56937 Mon Sep 17 00:00:00 2001
From: Hanjun Guo <email address hidden>
Date: Wed, 18 Sep 2013 17:19:23 +0800
Subject: [PATCH] ACPI: Introduce CONFIG_ACPI_REDUCED_HARDWARE to enable
 reduced hardware

If we want to enable reduced hardware ACPI on some platform (such as ARM),
we need to modify the kernel code and set ACPI_REDUCED_HARDWARE to TRUE.

This is not reasonable, so introduce a kernel config to enable it, and
no need for kernel modification when we use hardware-reduced ACPI.

Signed-off-by: Hanjun Guo <email address hidden>
---
 drivers/acpi/Kconfig | 8 ++++++++
 include/acpi/acconfig.h | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 0d7f6eb..1232a7b 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -413,6 +413,14 @@ config ACPI_BGRT
          data from the firmware boot splash. It will appear under
          /sys/firmware/acpi/bgrt/ .

+config ACPI_REDUCED_HARDWARE
+ bool "Hardware-reduced ACPI support"
+ depends on ARM || ARM64
+ help
+ This config adds support for Hardware-reduced ACPI. When this option
+ is selected, will generate a specialized version of ACPICA that ONLY
+ supports the ACPI 5.0 "reduced hardware".
+
 source "drivers/acpi/apei/Kconfig"

 endif # ACPI
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 1c16f82..15254f5 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -100,7 +100,11 @@
  * ACPI PM timer
  * FACS table (Waking vectors and Global Lock)
  */
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE
+#define ACPI_REDUCED_HARDWARE TRUE
+#else
 #define ACPI_REDUCED_HARDWARE FALSE
+#endif /* CONFIG_ACPI_REDUCED_HARDWARE */

 /******************************************************************************
  *
-- 1.7.9.5

Changed in linaro-acpi:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.