From: Al Stone ahs3@redhat.com
This series of patches starts with Hanjun's patch to create a kernel config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I then reviewed all of the code that touched any of several fields in the FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced mode [1]. Any time there was a use of one of the fields to be ignored, I evaluated whether or not the code was implementing Hardware Reduced mode correctly. Similarly, for each the flags in the FADT flags field that are to be ignored in Hardware Reduced mode, the kernel code was again scanned for proper usage. The remainder of the patches are to fix all of the situations I could find where the kernel would not behave correctly in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get some other eyes looking at them before sending them to linux-acpi@ where they really need to go. These seem to work just fine on the RTSM model for ARMv7, both with and without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2: -- Change patch series title -- Add in the FACS global lock patch as further hardware reduced mode cleanup that is needed -- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced mode. [0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5:...
Al Stone (13): ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode ACPI: bus master reload is unsupported in ACPI reduced HW mode ACPI: clean up compiler warning about uninitialized field ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field ACPI: ARM: exclude calls on ARM platforms, not include them on x86 ACPI: ensure several FADT fields are only used in HW reduced mode ACPI: do not reserve memory regions for some FADT entries in HW reduced mode ACPI: in HW reduced mode, getting power latencies from FADT is not allowed ACPI: add clarifying comment about processor throttling in HW reduced mode ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works properly ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 9 +++++---- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 13 files changed, 89 insertions(+), 28 deletions(-)
From: Al Stone ahs3@redhat.com
To enable the hardware reduced mode of ACPI on some platforms (such as ARM), we need to modify the kernel code and set ACPI_REDUCED_HARDWARE to TRUE in the ACPICA source.
This can be done more resonably by introducing a kernel config item to enable/disable ACPI_REDUCED_HARDWARE. We can then change the kernel config instead of having to modify the kernel source directly to enable the reduced hardware mode of ACPI.
Lv Zheng suggested that this configuration item does not belong in ACPICA, the upstream source for much of the ACPI internals, but rather to the Linux kernel itself. Hence, we introduce this flag so that we can make ACPI_REDUCED_HARDWARE configurable. For the details of the discussion, please refer to: http://www.spinics.net/lists/linux-acpi/msg46369.html
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/Kconfig | 8 ++++++++ include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 70813fe..099ca81 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -389,6 +389,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 !(IA64 || X86) + 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 "reduced hardware". + source "drivers/acpi/apei/Kconfig"
endif # ACPI diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 1c16f82..58b68ca 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -100,7 +100,7 @@ * ACPI PM timer * FACS table (Waking vectors and Global Lock) */ -#define ACPI_REDUCED_HARDWARE FALSE +#define ACPI_REDUCED_HARDWARE FLAG_ACPI_HW_REDUCED
/****************************************************************************** * diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 68534ef..ff3129a 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -174,6 +174,12 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) lock ? AE_OK : AE_NO_MEMORY; \ })
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE +#define FLAG_ACPI_HW_REDUCED TRUE +#else +#define FLAG_ACPI_HW_REDUCED FALSE +#endif /* CONFIG_ACPI_REDUCED_HARDWARE */ + #endif /* __KERNEL__ */
#endif /* __ACLINUX_H__ */
On 25 October 2013 06:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
To enable the hardware reduced mode of ACPI on some platforms (such as ARM), we need to modify the kernel code and set ACPI_REDUCED_HARDWARE to TRUE in the ACPICA source.
This can be done more resonably by introducing a kernel config item to enable/disable ACPI_REDUCED_HARDWARE. We can then change the kernel config instead of having to modify the kernel source directly to enable the reduced hardware mode of ACPI.
Lv Zheng suggested that this configuration item does not belong in ACPICA, the upstream source for much of the ACPI internals, but rather to the Linux kernel itself. Hence, we introduce this flag so that we can make ACPI_REDUCED_HARDWARE configurable. For the details of the discussion, please refer to: http://www.spinics.net/lists/linux-acpi/msg46369.html
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/Kconfig | 8 ++++++++ include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 70813fe..099ca81 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -389,6 +389,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 !(IA64 || X86)
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 "reduced hardware".
source "drivers/acpi/apei/Kconfig"
endif # ACPI diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 1c16f82..58b68ca 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -100,7 +100,7 @@
ACPI PM timer
FACS table (Waking vectors and Global Lock)
*/ -#define ACPI_REDUCED_HARDWARE FALSE +#define ACPI_REDUCED_HARDWARE FLAG_ACPI_HW_REDUCED
Intel guys have sent a new version of ACPICA, and they modified this macro as:
+#ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE +#endif
I think intel's patch is the response to the discussion of hardware-reduced ACPI profile that I started about one month ago.
so we should update this patch and rebased on the latest ACPICA version, I will do that.
Thanks Hanjun
On 10/29/2013 02:02 AM, Hanjun Guo wrote:
On 25 October 2013 06:23, <al.stone@linaro.org mailto:al.stone@linaro.org> wrote:
From: Al Stone <ahs3@redhat.com <mailto:ahs3@redhat.com>> To enable the hardware reduced mode of ACPI on some platforms (such as ARM), we need to modify the kernel code and set ACPI_REDUCED_HARDWARE to TRUE in the ACPICA source. This can be done more resonably by introducing a kernel config item to enable/disable ACPI_REDUCED_HARDWARE. We can then change the kernel config instead of having to modify the kernel source directly to enable the reduced hardware mode of ACPI. Lv Zheng suggested that this configuration item does not belong in ACPICA, the upstream source for much of the ACPI internals, but rather to the Linux kernel itself. Hence, we introduce this flag so that we can make ACPI_REDUCED_HARDWARE configurable. For the details of the discussion, please refer to: http://www.spinics.net/lists/linux-acpi/msg46369.html Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>> Signed-off-by: Al Stone <al.stone@linaro.org <mailto:al.stone@linaro.org>> --- drivers/acpi/Kconfig | 8 ++++++++ include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 70813fe..099ca81 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -389,6 +389,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 !(IA64 || X86) + 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 "reduced hardware". + source "drivers/acpi/apei/Kconfig" endif # ACPI diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 1c16f82..58b68ca 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -100,7 +100,7 @@ * ACPI PM timer * FACS table (Waking vectors and Global Lock) */ -#define ACPI_REDUCED_HARDWARE FALSE +#define ACPI_REDUCED_HARDWARE FLAG_ACPI_HW_REDUCED
Intel guys have sent a new version of ACPICA, and they modified this macro as:
+#ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE +#endif
I think intel's patch is the response to the discussion of hardware-reduced ACPI profile that I started about one month ago.
so we should update this patch and rebased on the latest ACPICA version, I will do that.
Thanks Hanjun
I'll resubmit this as an actual patch (vs RFC) for the Linaro tree and do a separate patch for the linux-acpi tree since they have already moved to the newer ACPI code. Whenever we sync with the upstream tree, we'll then pull in the version of the patch that works with that version of the source tree.
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduced HW mode; according to the spec, no such registers should exist.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/processor_idle.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e45f913..3cee9a1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,14 +219,29 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#if (!ACPI_REDUCED_HARDWARE) +/* Bus Master Reload is not supported in the reduced hardware profile */ static u32 saved_bm_rld; +#endif
+#ifdef ACPI_REDUCED_HARDWARE +/* Bus Master Reload is not supported in the reduced hardware profile */ +static int acpi_processor_suspend(void) +{ + return 0; +} +#else static int acpi_processor_suspend(void) { acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); return 0; } +#endif
+#ifdef ACPI_REDUCED_HARDWARE +/* Bus Master Reload is not supported in the reduced hardware profile */ +static void acpi_processor_resume(void) { } +#else static void acpi_processor_resume(void) { u32 resumed_bm_rld; @@ -237,6 +252,7 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#endif
static struct syscore_ops acpi_processor_syscore_ops = { .suspend = acpi_processor_suspend,
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduced HW mode; according to the spec, no such registers should exist.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e45f913..3cee9a1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,14 +219,29 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif #ifdef CONFIG_PM_SLEEP +#if (!ACPI_REDUCED_HARDWARE) +/* Bus Master Reload is not supported in the reduced hardware profile */ static u32 saved_bm_rld; +#endif +#ifdef ACPI_REDUCED_HARDWARE
I think here would be #ifdef CONFIG_ACPI_REDUCED_HARDWARE or #if (!ACPI_REDUCED_HARDWARE)
because ACPI_REDUCED_HARDWARE will always defined no matter the value is FALSE or TRUE.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static int acpi_processor_suspend(void) +{
- return 0;
+} +#else static int acpi_processor_suspend(void) { acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); return 0; } +#endif +#ifdef ACPI_REDUCED_HARDWARE
Here too.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static void acpi_processor_resume(void) { } +#else static void acpi_processor_resume(void) { u32 resumed_bm_rld; @@ -237,6 +252,7 @@ static void acpi_processor_resume(void) acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#endif
Since saved_bm_rld and acpi_processor_suspend/resume() are all should redefined when in HW reduced mode, how about do it like this?
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..942a2f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,6 +219,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#ifndef CONFIG_ACPI_REDUCED_HARDWARE static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,10 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#else +static int acpi_processor_suspend(void) {return 0;} +static void acpi_processor_resume(void) {return;} +#endif /* CONFIG_ACPI_REDUCED_HARDWARE */
Thanks Hanjun
On 10/25/2013 03:52 AM, Hanjun Guo wrote:
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduced HW mode; according to the spec, no such registers should exist.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e45f913..3cee9a1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,14 +219,29 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#if (!ACPI_REDUCED_HARDWARE) +/* Bus Master Reload is not supported in the reduced hardware profile */ static u32 saved_bm_rld; +#endif
+#ifdef ACPI_REDUCED_HARDWARE
I think here would be #ifdef CONFIG_ACPI_REDUCED_HARDWARE or #if (!ACPI_REDUCED_HARDWARE)
because ACPI_REDUCED_HARDWARE will always defined no matter the value is FALSE or TRUE.
Oops. Thinko on my part. I'll fix this.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static int acpi_processor_suspend(void) +{
- return 0;
+} +#else static int acpi_processor_suspend(void) { acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); return 0; } +#endif
+#ifdef ACPI_REDUCED_HARDWARE
Here too.
Ack. I'll scan the code and make sure there are no more of these, too.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static void acpi_processor_resume(void) { } +#else static void acpi_processor_resume(void) { u32 resumed_bm_rld; @@ -237,6 +252,7 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#endif
Since saved_bm_rld and acpi_processor_suspend/resume() are all should redefined when in HW reduced mode, how about do it like this?
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..942a2f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,6 +219,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#ifndef CONFIG_ACPI_REDUCED_HARDWARE static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,10 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
} +#else +static int acpi_processor_suspend(void) {return 0;} +static void acpi_processor_resume(void) {return;} +#endif /* CONFIG_ACPI_REDUCED_HARDWARE */
Hrm. That looks a lot cleaner. Thanks for the suggestion.
Thanks Hanjun
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
On 10/25/2013 03:52 AM, Hanjun Guo wrote:
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduced HW mode; according to the spec, no such registers should exist.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e45f913..3cee9a1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,14 +219,29 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#if (!ACPI_REDUCED_HARDWARE) +/* Bus Master Reload is not supported in the reduced hardware profile */ static u32 saved_bm_rld; +#endif
+#ifdef ACPI_REDUCED_HARDWARE
I think here would be #ifdef CONFIG_ACPI_REDUCED_HARDWARE or #if (!ACPI_REDUCED_HARDWARE)
because ACPI_REDUCED_HARDWARE will always defined no matter the value is FALSE or TRUE.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static int acpi_processor_suspend(void) +{
- return 0;
+} +#else static int acpi_processor_suspend(void) { acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); return 0; } +#endif
+#ifdef ACPI_REDUCED_HARDWARE
Here too.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static void acpi_processor_resume(void) { } +#else static void acpi_processor_resume(void) { u32 resumed_bm_rld; @@ -237,6 +252,7 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#endif
Since saved_bm_rld and acpi_processor_suspend/resume() are all should redefined when in HW reduced mode, how about do it like this?
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..942a2f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,6 +219,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#ifndef CONFIG_ACPI_REDUCED_HARDWARE static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,10 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
} +#else +static int acpi_processor_suspend(void) {return 0;} +static void acpi_processor_resume(void) {return;} +#endif /* CONFIG_ACPI_REDUCED_HARDWARE */
Thanks Hanjun
Much cleaner; this will show up in the next version. Thanks.
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 14df305..721e949 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -525,7 +525,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) * generate wakeup events. */ if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) { - acpi_event_status pwr_btn_status; + acpi_event_status pwr_btn_status = ACPI_EVENT_FLAG_DISABLED;
acpi_get_event_status(ACPI_EVENT_POWER_BUTTON, &pwr_btn_status);
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
Reviewed-by: Hanjun Guo hanjun.guo@linaro.org
drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 14df305..721e949 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -525,7 +525,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) * generate wakeup events. */ if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) {
acpi_event_status pwr_btn_status;
acpi_event_status pwr_btn_status = ACPI_EVENT_FLAG_DISABLED;
acpi_get_event_status(ACPI_EVENT_POWER_BUTTON, &pwr_btn_status);
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/bus.c | 3 ++- drivers/acpi/osl.c | 10 ++++++---- drivers/acpi/pci_link.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 439c369..7fcbc6a 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -543,7 +543,8 @@ void __init acpi_early_init(void) goto error0; }
-#ifdef CONFIG_X86 +#if (!CONFIG_ACPI_REDUCED_HARDWARE) + /* NB: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */ if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) { diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 34beeba..75da583 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -85,6 +85,7 @@ static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a,
static acpi_osd_handler acpi_irq_handler; static void *acpi_irq_context; +static u32 acpi_irq_number; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_hotplug_wq; @@ -841,9 +842,9 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
/* * ACPI interrupts different from the SCI in our copy of the FADT are - * not supported. + * not supported, except in HW reduced mode. */ - if (gsi != acpi_gbl_FADT.sci_interrupt) + if (!acpi_gbl_reduced_hardware && (gsi != acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
if (acpi_irq_handler) @@ -862,13 +863,14 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = NULL; return AE_NOT_ACQUIRED; } + acpi_irq_number = irq;
return AE_OK; }
acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) { - if (irq != acpi_gbl_FADT.sci_interrupt) + if (!acpi_gbl_reduced_hardware && (irq != acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
free_irq(irq, acpi_irq); @@ -1845,7 +1847,7 @@ acpi_status __init acpi_os_initialize1(void) acpi_status acpi_os_terminate(void) { if (acpi_irq_handler) { - acpi_os_remove_interrupt_handler(acpi_gbl_FADT.sci_interrupt, + acpi_os_remove_interrupt_handler(acpi_irq_number, acpi_irq_handler); }
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 2652a61..c0ab28a 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -23,7 +23,7 @@ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * - * TBD: + * TBD: * 1. Support more than one IRQ resource entry per link device (index). * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities * for IRQ management (e.g. start()->_SRS). @@ -268,8 +268,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) } }
- /* - * Query and parse _CRS to get the current IRQ assignment. + /* + * Query and parse _CRS to get the current IRQ assignment. */
status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, @@ -415,7 +415,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /* * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt * Link Devices to move the PIRQs around to minimize sharing. - * + * * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs * that the BIOS has already set to active. This is necessary because * ACPI has no automatic means of knowing what ISA IRQs are used. Note that @@ -433,7 +433,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) * * Note that PCI IRQ routers have a list of possible IRQs, * which may not include the IRQs this table says are available. - * + * * Since this heuristic can't tell the difference between a link * that no device will attach to, vs. a link which may be shared * by multiple active devices -- it is not optimal. @@ -505,7 +505,9 @@ int __init acpi_irq_penalty_init(void) } } /* Add a penalty for the SCI */ - acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING; + if (!acpi_gbl_reduced_hardware) + acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += + PIRQ_PENALTY_PCI_USING; return 0; }
W dniu 10/24/13 15:23, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 3 ++- drivers/acpi/osl.c | 10 ++++++---- drivers/acpi/pci_link.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 439c369..7fcbc6a 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -543,7 +543,8 @@ void __init acpi_early_init(void) goto error0; }
-#ifdef CONFIG_X86 +#if (!CONFIG_ACPI_REDUCED_HARDWARE)
- /* NB: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */ if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) {
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 34beeba..75da583 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -85,6 +85,7 @@ static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a,
static acpi_osd_handler acpi_irq_handler; static void *acpi_irq_context; +static u32 acpi_irq_number; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_hotplug_wq; @@ -841,9 +842,9 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
/* * ACPI interrupts different from the SCI in our copy of the FADT are
* not supported.
*/* not supported, except in HW reduced mode.
- if (gsi != acpi_gbl_FADT.sci_interrupt)
- if (!acpi_gbl_reduced_hardware && (gsi != acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
I am not sure we need this, since going up we are already protected in acpi_ev_initialize_events() and acpi_ev_install_xrupt_handlers() under the same condition.
BTW. I do not get the idea of blocking handler registration other than acpi_gbl_FADT.sci_interrupt. But this is out of patch scope.
if (acpi_irq_handler) @@ -862,13 +863,14 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = NULL; return AE_NOT_ACQUIRED; }
- acpi_irq_number = irq;
Doing that you can not be sure acpi_irq_number == acpi_gbl_FADT.sci_interrupt, so acpi_os_remove_interrupt_handler() won't let you to remove interrupt handler.
return AE_OK; }
acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) {
- if (irq != acpi_gbl_FADT.sci_interrupt)
if (!acpi_gbl_reduced_hardware && (irq != acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
free_irq(irq, acpi_irq);
@@ -1845,7 +1847,7 @@ acpi_status __init acpi_os_initialize1(void) acpi_status acpi_os_terminate(void) { if (acpi_irq_handler) {
acpi_os_remove_interrupt_handler(acpi_gbl_FADT.sci_interrupt,
}acpi_os_remove_interrupt_handler(acpi_irq_number, acpi_irq_handler);
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 2652a61..c0ab28a 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -23,7 +23,7 @@
- TBD:
- TBD:
1. Support more than one IRQ resource entry per link device (index).
- Implement start/stop mechanism and use ACPI Bus Driver facilities
for IRQ management (e.g. start()->_SRS).
@@ -268,8 +268,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) } }
- /*
* Query and parse _CRS to get the current IRQ assignment.
/*
* Query and parse _CRS to get the current IRQ assignment.
*/
status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,
@@ -415,7 +415,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /*
- "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt
- Link Devices to move the PIRQs around to minimize sharing.
- "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs
- that the BIOS has already set to active. This is necessary because
- ACPI has no automatic means of knowing what ISA IRQs are used. Note that
@@ -433,7 +433,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
- Note that PCI IRQ routers have a list of possible IRQs,
- which may not include the IRQs this table says are available.
- Since this heuristic can't tell the difference between a link
- that no device will attach to, vs. a link which may be shared
- by multiple active devices -- it is not optimal.
@@ -505,7 +505,9 @@ int __init acpi_irq_penalty_init(void) } } /* Add a penalty for the SCI */
- acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING;
- if (!acpi_gbl_reduced_hardware)
acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] +=
return 0; }PIRQ_PENALTY_PCI_USING;
On 10/28/2013 01:49 PM, Tomasz Nowicki wrote:
W dniu 10/24/13 15:23, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 3 ++- drivers/acpi/osl.c | 10 ++++++---- drivers/acpi/pci_link.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 439c369..7fcbc6a 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -543,7 +543,8 @@ void __init acpi_early_init(void) goto error0; }
-#ifdef CONFIG_X86 +#if (!CONFIG_ACPI_REDUCED_HARDWARE)
- /* NB: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */ if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) {
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 34beeba..75da583 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -85,6 +85,7 @@ static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a,
static acpi_osd_handler acpi_irq_handler; static void *acpi_irq_context; +static u32 acpi_irq_number; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_hotplug_wq; @@ -841,9 +842,9 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
/* * ACPI interrupts different from the SCI in our copy of the
FADT are
* not supported.
* not supported, except in HW reduced mode. */
- if (gsi != acpi_gbl_FADT.sci_interrupt)
- if (!acpi_gbl_reduced_hardware && (gsi !=
acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
I am not sure we need this, since going up we are already protected in acpi_ev_initialize_events() and acpi_ev_install_xrupt_handlers() under the same condition.
My thinking is that if gsi != sci_interrupt, we will not be able to register gsi at all in reduced HW mode (this test would always fail since sci_interrupt would always be zero). So I'm thinking this change is still needed.
BTW. I do not get the idea of blocking handler registration other than acpi_gbl_FADT.sci_interrupt. But this is out of patch scope.
I'll re-read the code just to be sure, but the changes are meant to _allow_ handler registration other than sci_interrupt. At least the way I was reading the code, you could not register a handler if it was _not_ the sci_interrupt.
if (acpi_irq_handler)
@@ -862,13 +863,14 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = NULL; return AE_NOT_ACQUIRED; }
- acpi_irq_number = irq;
Doing that you can not be sure acpi_irq_number == acpi_gbl_FADT.sci_interrupt, so acpi_os_remove_interrupt_handler() won't let you to remove interrupt handler.
Hrm. I'll check acpi_os_remove_interrupt_handler to make it behaves, too. Thanks.
return AE_OK;
}
acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) {
- if (irq != acpi_gbl_FADT.sci_interrupt)
- if (!acpi_gbl_reduced_hardware && (irq !=
acpi_gbl_FADT.sci_interrupt)) return AE_BAD_PARAMETER;
Aha. I did fix this -- again, in reduced HW, sci_interrupt will always be zero so this test would always be true, regardless of which handler is being removed, so you would never be able to remove a handler without this change.
free_irq(irq, acpi_irq);
@@ -1845,7 +1847,7 @@ acpi_status __init acpi_os_initialize1(void) acpi_status acpi_os_terminate(void) { if (acpi_irq_handler) {
acpi_os_remove_interrupt_handler(acpi_gbl_FADT.sci_interrupt,
acpi_os_remove_interrupt_handler(acpi_irq_number, acpi_irq_handler); }
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 2652a61..c0ab28a 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -23,7 +23,7 @@
* - * TBD: + * TBD: * 1. Support more than one IRQ resource entry per link device (index). * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities * for IRQ management (e.g. start()->_SRS). @@ -268,8 +268,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) } } - /* - * Query and parse _CRS to get the current IRQ assignment. + /* + * Query and parse _CRS to get the current IRQ assignment. */ status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, @@ -415,7 +415,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /* * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt * Link Devices to move the PIRQs around to minimize sharing. - * + * * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs * that the BIOS has already set to active. This is necessary because * ACPI has no automatic means of knowing what ISA IRQs are used. Note that @@ -433,7 +433,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) * * Note that PCI IRQ routers have a list of possible IRQs, * which may not include the IRQs this table says are available. - * + * * Since this heuristic can't tell the difference between a link * that no device will attach to, vs. a link which may be shared * by multiple active devices -- it is not optimal. @@ -505,7 +505,9 @@ int __init acpi_irq_penalty_init(void) } } /* Add a penalty for the SCI */ - acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING; + if (!acpi_gbl_reduced_hardware) + acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += + PIRQ_PENALTY_PCI_USING; return 0; }
From: Al Stone ahs3@redhat.com
Corrected #ifdefs to make sure we are not using an ARM platform (32- or 64-bit), instead of testing whether we are on x86, since ACPI is used on other platforms as well.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..ed99fec 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) #include <asm/mpspec.h> #endif #include <linux/pci.h> @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); #define STRUCT_TO_INT(s) (*((int*)&s))
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) static int set_copy_dsdt(const struct dmi_system_id *id) { printk(KERN_NOTICE "%s detected - " @@ -512,7 +512,7 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) /* * NB: ARM does not use DMI; only older Intel products do. *
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Corrected #ifdefs to make sure we are not using an ARM platform (32- or 64-bit), instead of testing whether we are on x86, since ACPI is used on other platforms as well.
Will this break IA64? I think CONFIG_X86 used here may have special handler for x86 only. anyway, I have no full confidence about it :)
Thanks Hanjun
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..ed99fec 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) #include <asm/mpspec.h> #endif #include <linux/pci.h> @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); #define STRUCT_TO_INT(s) (*((int*)&s)) -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) static int set_copy_dsdt(const struct dmi_system_id *id) { printk(KERN_NOTICE "%s detected - " @@ -512,7 +512,7 @@ void __init acpi_early_init(void) acpi_gbl_permanent_mmap = 1; -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) /* * NB: ARM does not use DMI; only older Intel products do. *
On 10/25/2013 04:02 AM, Hanjun Guo wrote:
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Corrected #ifdefs to make sure we are not using an ARM platform (32- or 64-bit), instead of testing whether we are on x86, since ACPI is used on other platforms as well.
Will this break IA64? I think CONFIG_X86 used here may have special handler for x86 only. anyway, I have no full confidence about it :)
Thanks Hanjun
I don't _think_ this will break ia64; it's part of why I was thinking this is necessary. I'll see if I can cross-compile it just to be sure.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..ed99fec 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) #include <asm/mpspec.h> #endif #include <linux/pci.h> @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); #define STRUCT_TO_INT(s) (*((int*)&s))
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) static int set_copy_dsdt(const struct dmi_system_id *id) { printk(KERN_NOTICE "%s detected - " @@ -512,7 +512,7 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) /* * NB: ARM does not use DMI; only older Intel products do. *
On 10/25/2013 04:02 AM, Hanjun Guo wrote:
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Corrected #ifdefs to make sure we are not using an ARM platform (32- or 64-bit), instead of testing whether we are on x86, since ACPI is used on other platforms as well.
Will this break IA64? I think CONFIG_X86 used here may have special handler for x86 only. anyway, I have no full confidence about it :)
Thanks Hanjun
Aha. git blame is marvelous. I had thought these were #ifdef CONFIG_X86 lines that *I* had put in to get things to work on ARM; not true, it turns out, except for the last one. I'll fix this patch so only the last part is used.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..ed99fec 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> -#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) #include <asm/mpspec.h> #endif #include <linux/pci.h> @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); #define STRUCT_TO_INT(s) (*((int*)&s))
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) static int set_copy_dsdt(const struct dmi_system_id *id) { printk(KERN_NOTICE "%s detected - " @@ -512,7 +512,7 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(CONFIG_ARM || CONFIG_ARM64) /* * NB: ARM does not use DMI; only older Intel products do. *
From: Al Stone ahs3@redhat.com
In acpi_os_terminate(), it was assumed that several FADT entries were mapped into memory. For HW reduced mode, that will not be the case.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/osl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 75da583..8f4956d 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1851,10 +1851,12 @@ acpi_status acpi_os_terminate(void) acpi_irq_handler); }
- acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe1_block); - acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block); - acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block); - acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block); + if (!acpi_gbl_reduced_hardware) { + acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe1_block); + acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block); + acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block); + acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block); + }
destroy_workqueue(kacpid_wq); destroy_workqueue(kacpi_notify_wq);
From: Al Stone ahs3@redhat.com
Since some of the FADT fields reserved are not to be used by the OSPM, do not map in the memory areas that the FADT fields reference.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/osl.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 8f4956d..0912066 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -161,6 +161,9 @@ static u32 acpi_osi_handler(acpi_string interface, u32 supported) return supported; }
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE +static int __init acpi_reserve_resources(void) { return 0; } +#else static void __init acpi_request_region (struct acpi_generic_address *gas, unsigned int length, char *desc) { @@ -210,6 +213,7 @@ static int __init acpi_reserve_resources(void)
return 0; } +#endif device_initcall(acpi_reserve_resources);
void acpi_os_printf(const char *fmt, ...) @@ -1821,6 +1825,9 @@ static int __init acpi_no_auto_ssdt_setup(char *s)
__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup);
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE +acpi_status __init acpi_os_initialize(void) { return AE_OK; } +#else acpi_status __init acpi_os_initialize(void) { acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1a_event_block); @@ -1830,6 +1837,7 @@ acpi_status __init acpi_os_initialize(void)
return AE_OK; } +#endif
acpi_status __init acpi_os_initialize1(void) {
From: Al Stone ahs3@redhat.com
Make sure we are not in HW reduced mode when we rely on the the P_LVL2_LAT or P_LVL3_LAT (c2_latency, c3_latency) values from the FADT.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/processor_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3cee9a1..3e20b4c 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -666,7 +666,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) memset(pr->power.states, 0, sizeof(pr->power.states));
result = acpi_processor_get_power_info_cst(pr); - if (result == -ENODEV) + if (!acpi_gbl_reduced_hardware && (result == -ENODEV)) result = acpi_processor_get_power_info_fadt(pr);
if (result)
W dniu 10/24/13 15:23, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
Make sure we are not in HW reduced mode when we rely on the the P_LVL2_LAT or P_LVL3_LAT (c2_latency, c3_latency) values from the FADT.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3cee9a1..3e20b4c 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -666,7 +666,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) memset(pr->power.states, 0, sizeof(pr->power.states));
result = acpi_processor_get_power_info_cst(pr);
- if (result == -ENODEV)
if (!acpi_gbl_reduced_hardware && (result == -ENODEV)) result = acpi_processor_get_power_info_fadt(pr);
if (result)
Correct me if I'm wrong but I think this patch would not be necessary if we would apply [PATCH 10/13] from this series.
Tomasz
On 10/28/2013 05:05 PM, Tomasz Nowicki wrote:
W dniu 10/24/13 15:23, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
Make sure we are not in HW reduced mode when we rely on the the P_LVL2_LAT or P_LVL3_LAT (c2_latency, c3_latency) values from the FADT.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3cee9a1..3e20b4c 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -666,7 +666,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) memset(pr->power.states, 0, sizeof(pr->power.states));
result = acpi_processor_get_power_info_cst(pr);
- if (result == -ENODEV)
if (!acpi_gbl_reduced_hardware && (result == -ENODEV)) result = acpi_processor_get_power_info_fadt(pr);
if (result)
Correct me if I'm wrong but I think this patch would not be necessary if we would apply [PATCH 10/13] from this series.
Tomasz
I think it's still needed. Regardless of whether or not the _CST exists and parses properly, we should never get PM info from the FADT in reduced HW mode. Adding the test protects us from faulty _CST data in reduced HW mode.
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/processor_throttling.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index e7dd2c1..200738e 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -942,6 +942,10 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr) return -EINVAL; }
+ /* + * NB: in HW reduced mode, duty_width is always zero + * so this count may not be what is wanted. + */ pr->throttling.state_count = 1 << acpi_gbl_FADT.duty_width;
/* @@ -991,6 +995,10 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr, /* Used to clear all duty_value bits */ duty_mask = pr->throttling.state_count - 1;
+ /* + * NB: in HW reduced mode, duty_offset is always zero + * so this mask may not be what is wanted. + */ duty_mask <<= acpi_gbl_FADT.duty_offset; duty_mask = ~duty_mask; }
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/processor_idle.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3e20b4c..c6c8058 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -312,7 +312,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * Check for P_LVL2_UP flag before entering C2 and above on * an SMP system. */ - if ((num_online_cpus() > 1) && + if (!acpi_gbl_reduced_hardware && + (num_online_cpus() > 1) && !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) return -ENODEV; #endif @@ -1014,7 +1015,8 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, continue;
#ifdef CONFIG_HOTPLUG_CPU - if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && + if (!acpi_gbl_reduced_hardware && + (cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && !pr->flags.has_cst && !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) continue; @@ -1069,7 +1071,8 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) continue;
#ifdef CONFIG_HOTPLUG_CPU - if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && + if (!acpi_gbl_reduced_hardware && + (cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && !pr->flags.has_cst && !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) continue;
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/acpica/utxface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index 03a211e..ab55195 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c @@ -186,7 +186,8 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
/* Timer resolution - 24 or 32 bits */
- if (acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER) { + if (!acpi_gbl_reduced_hardware && + (acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER)) { info_ptr->timer_resolution = 24; } else { info_ptr->timer_resolution = 32;
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/bus.c | 2 +- drivers/acpi/processor_idle.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index ed99fec..921c335 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -543,7 +543,7 @@ void __init acpi_early_init(void) goto error0; }
-#if (!CONFIG_ACPI_REDUCED_HARDWARE) +#if !(CONFIG_ARM || CONFIG_ARM64) && (!ACPI_REDUCED_HARDWARE) /* NB: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */ diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index c6c8058..f85eb05 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -224,7 +224,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, static u32 saved_bm_rld; #endif
-#ifdef ACPI_REDUCED_HARDWARE +#if (ACPI_REDUCED_HARDWARE) /* Bus Master Reload is not supported in the reduced hardware profile */ static int acpi_processor_suspend(void) { @@ -238,7 +238,7 @@ static int acpi_processor_suspend(void) } #endif
-#ifdef ACPI_REDUCED_HARDWARE +#if (ACPI_REDUCED_HARDWARE) /* Bus Master Reload is not supported in the reduced hardware profile */ static void acpi_processor_resume(void) { } #else
From: Al Stone ahs3@redhat.com
This patch is dependent on the CONFIG_ACPI_REDUCED_HARDWARE patch already being in place.
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/plat/arm/boot.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h index ca7efaa..cf67b09 100644 --- a/arch/arm/include/asm/acpi.h +++ b/arch/arm/include/asm/acpi.h @@ -82,6 +82,7 @@ /* Blob handling macros */ #define ACPI_BLOB_HEADER_SIZE 8
+#ifndef CONFIG_ACPI_REDUCED_HARDWARE int __acpi_acquire_global_lock(unsigned int *lock); int __acpi_release_global_lock(unsigned int *lock);
@@ -90,9 +91,9 @@ int __acpi_release_global_lock(unsigned int *lock);
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ ((Acq) = __acpi_release_global_lock(&facs->global_lock)) +#endif
/* Basic configuration for ACPI */ -/* BOZO: hardware reduced acpi only? */ #ifdef CONFIG_ACPI extern int acpi_disabled; extern int acpi_noirq; diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index a19b73f..bb9411f 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -60,6 +60,7 @@ /* Blob handling macros */ #define ACPI_BLOB_HEADER_SIZE 8
+#ifndef CONFIG_ACPI_REDUCED_HARDWARE int __acpi_acquire_global_lock(unsigned int *lock); int __acpi_release_global_lock(unsigned int *lock);
@@ -68,9 +69,9 @@ int __acpi_release_global_lock(unsigned int *lock);
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ ((Acq) = __acpi_release_global_lock(&facs->global_lock)) +#endif
/* Basic configuration for ACPI */ -/* BOZO: hardware reduced acpi only? */ #ifdef CONFIG_ACPI extern int acpi_disabled; extern int acpi_noirq; diff --git a/drivers/acpi/plat/arm/boot.c b/drivers/acpi/plat/arm/boot.c index 4fcdd9f..1a6d225 100644 --- a/drivers/acpi/plat/arm/boot.c +++ b/drivers/acpi/plat/arm/boot.c @@ -786,6 +786,7 @@ static int __init parse_acpi(char *arg) } early_param("acpi", parse_acpi);
+#if (!ACPI_REDUCED_HARDWARE) int __acpi_acquire_global_lock(unsigned int *lock) { unsigned int old, new, val; @@ -807,3 +808,4 @@ int __acpi_release_global_lock(unsigned int *lock) } while (unlikely (val != old)); return old & 0x1; } +#endif
W dniu 25.10.2013 00:22, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
This series of patches starts with Hanjun's patch to create a kernel config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I then reviewed all of the code that touched any of several fields in the FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced mode [1]. Any time there was a use of one of the fields to be ignored, I evaluated whether or not the code was implementing Hardware Reduced mode correctly. Similarly, for each the flags in the FADT flags field that are to be ignored in Hardware Reduced mode, the kernel code was again scanned for proper usage. The remainder of the patches are to fix all of the situations I could find where the kernel would not behave correctly in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get some other eyes looking at them before sending them to linux-acpi@ where they really need to go. These seem to work just fine on the RTSM model for ARMv7, both with and without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2: -- Change patch series title -- Add in the FACS global lock patch as further hardware reduced mode cleanup that is needed -- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced mode. [0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5:...
Al Stone (13): ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode ACPI: bus master reload is unsupported in ACPI reduced HW mode ACPI: clean up compiler warning about uninitialized field ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field ACPI: ARM: exclude calls on ARM platforms, not include them on x86 ACPI: ensure several FADT fields are only used in HW reduced mode ACPI: do not reserve memory regions for some FADT entries in HW reduced mode ACPI: in HW reduced mode, getting power latencies from FADT is not allowed ACPI: add clarifying comment about processor throttling in HW reduced mode ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works properly ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 9 +++++---- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 13 files changed, 89 insertions(+), 28 deletions(-)
Hi Al,
As we discussed in Santa Clara, we should consider using of ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro everywhere it's related to ACPICA internal code.
Tomasz
On 2013-11-5 17:01, Tomasz Nowicki wrote:
W dniu 25.10.2013 00:22, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
This series of patches starts with Hanjun's patch to create a kernel config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I then reviewed all of the code that touched any of several fields in the FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced mode [1]. Any time there was a use of one of the fields to be ignored, I evaluated whether or not the code was implementing Hardware Reduced mode correctly. Similarly, for each the flags in the FADT flags field that are to be ignored in Hardware Reduced mode, the kernel code was again scanned for proper usage. The remainder of the patches are to fix all of the situations I could find where the kernel would not behave correctly in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get some other eyes looking at them before sending them to linux-acpi@ where they really need to go. These seem to work just fine on the RTSM model for ARMv7, both with and without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2: -- Change patch series title -- Add in the FACS global lock patch as further hardware reduced mode cleanup that is needed -- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced mode. [0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5:...
Al Stone (13): ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode ACPI: bus master reload is unsupported in ACPI reduced HW mode ACPI: clean up compiler warning about uninitialized field ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field ACPI: ARM: exclude calls on ARM platforms, not include them on x86 ACPI: ensure several FADT fields are only used in HW reduced mode ACPI: do not reserve memory regions for some FADT entries in HW reduced mode ACPI: in HW reduced mode, getting power latencies from FADT is not allowed ACPI: add clarifying comment about processor throttling in HW reduced mode ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works properly ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 9 +++++---- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 13 files changed, 89 insertions(+), 28 deletions(-)
Hi Al,
As we discussed in Santa Clara, we should consider using of ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro everywhere it's related to ACPICA internal code.
Sorry I didn't catch up with you here, why we should use ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro? This patch set is about ACPI driver changing but not ACPICA, did I miss something?
Thanks Hanjun
On 11/05/13 12:53, Hanjun Guo wrote:
On 2013-11-5 17:01, Tomasz Nowicki wrote:
W dniu 25.10.2013 00:22, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
This series of patches starts with Hanjun's patch to create a kernel config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I then reviewed all of the code that touched any of several fields in the FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced mode [1]. Any time there was a use of one of the fields to be ignored, I evaluated whether or not the code was implementing Hardware Reduced mode correctly. Similarly, for each the flags in the FADT flags field that are to be ignored in Hardware Reduced mode, the kernel code was again scanned for proper usage. The remainder of the patches are to fix all of the situations I could find where the kernel would not behave correctly in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get some other eyes looking at them before sending them to linux-acpi@ where they really need to go. These seem to work just fine on the RTSM model for ARMv7, both with and without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2: -- Change patch series title -- Add in the FACS global lock patch as further hardware reduced mode cleanup that is needed -- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced mode. [0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5:...
Al Stone (13): ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode ACPI: bus master reload is unsupported in ACPI reduced HW mode ACPI: clean up compiler warning about uninitialized field ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field ACPI: ARM: exclude calls on ARM platforms, not include them on x86 ACPI: ensure several FADT fields are only used in HW reduced mode ACPI: do not reserve memory regions for some FADT entries in HW reduced mode ACPI: in HW reduced mode, getting power latencies from FADT is not allowed ACPI: add clarifying comment about processor throttling in HW reduced mode ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works properly ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 9 +++++---- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 13 files changed, 89 insertions(+), 28 deletions(-)
Hi Al,
As we discussed in Santa Clara, we should consider using of ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro everywhere it's related to ACPICA internal code.
Sorry I didn't catch up with you here, why we should use ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro? This patch set is about ACPI driver changing but not ACPICA, did I miss something?
Thanks Hanjun
I have seen many places that create function prototype or just empty content in this patch set depends on whether we are in hardware reduced mode or not. My idea was to use ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID}, however, this macro is used internally by ACPICA code and I am not sure we could use the same one or just create the new one.
Tomasz
On 5 November 2013 20:06, Tomasz Nowicki tomasz.nowicki@linaro.org wrote:
On 11/05/13 12:53, Hanjun Guo wrote:
On 2013-11-5 17:01, Tomasz Nowicki wrote:
W dniu 25.10.2013 00:22, al.stone@linaro.org pisze:
From: Al Stone ahs3@redhat.com
This series of patches starts with Hanjun's patch to create a kernel config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I then reviewed all of the code that touched any of several fields in the FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced mode [1]. Any time there was a use of one of the fields to be ignored, I evaluated whether or not the code was implementing Hardware Reduced mode correctly. Similarly, for each the flags in the FADT flags field that are to be ignored in Hardware Reduced mode, the kernel code was again scanned for proper usage. The remainder of the patches are to fix all of the situations I could find where the kernel would not behave correctly in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get some other eyes looking at them before sending them to linux-acpi@where they really need to go. These seem to work just fine on the RTSM model for ARMv7, both with and without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2: -- Change patch series title -- Add in the FACS global lock patch as further hardware reduced mode cleanup that is needed -- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced mode. [0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/ AcpiReducedHw#Section_5:_ACPI_Software_Programming_Model
Al Stone (13): ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode ACPI: bus master reload is unsupported in ACPI reduced HW mode ACPI: clean up compiler warning about uninitialized field ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field ACPI: ARM: exclude calls on ARM platforms, not include them on x86 ACPI: ensure several FADT fields are only used in HW reduced mode ACPI: do not reserve memory regions for some FADT entries in HW reduced mode ACPI: in HW reduced mode, getting power latencies from FADT is not allowed ACPI: add clarifying comment about processor throttling in HW reduced mode ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works properly ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 3 ++- arch/arm64/include/asm/acpi.h | 3 ++- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 9 +++++---- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/platform/aclinux.h | 6 ++++++ 13 files changed, 89 insertions(+), 28 deletions(-)
Hi Al,
As we discussed in Santa Clara, we should consider using of ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro everywhere it's related to ACPICA internal code.
Sorry I didn't catch up with you here, why we should use ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macro? This patch set is about ACPI driver changing but not ACPICA, did I miss something?
Thanks Hanjun
I have seen many places that create function prototype or just empty
content in this patch set depends on whether we are in hardware reduced mode or not. My idea was to use ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID}, however, this macro is used internally by ACPICA code and I am not sure we could use the same one or just create the new one.
Got it, thanks for the explanation :) ACPI_HW_DEPENDENT_RETURN_{STATUS,OK,VOID} macros are for head files, I think we can use them if we need in ACPI drivers.
Tomasz