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.
NB: these changes are only applicable to the LEG ACPI working tree. The macros in patch 1/13 will have to change for the linux-acpi tree.
Changes for v4: -- Remove use of ACPI_HW_DEPENDENT_RETURN_{*} macros; they were not usable without invasive change. -- Completely remove global lock/unlock routines on ARM (vs #ifdef)
Changes for v3: -- Consistent use of #if (!ACPI_REDUCED_HARDWARE) -- Use of ACPI_HW_DEPENDENT_RETURN_{*} macros -- Simplify wherever possible
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 not supported in 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 #ifdef so compilation without ACPI_REDUCED_HARDWARE works ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW reduced mode
arch/arm/include/asm/acpi.h | 10 ---------- arch/arm64/include/asm/acpi.h | 10 ---------- drivers/acpi/Kconfig | 8 ++++++++ drivers/acpi/acpica/utxface.c | 3 ++- drivers/acpi/bus.c | 7 ++++--- drivers/acpi/osl.c | 28 ++++++++++++++++++++-------- drivers/acpi/pci_link.c | 14 ++++++++------ drivers/acpi/plat/arm/boot.c | 2 ++ drivers/acpi/processor_idle.c | 19 ++++++++++++++----- drivers/acpi/processor_throttling.c | 8 ++++++++ drivers/acpi/sleep.c | 2 +- include/acpi/acconfig.h | 2 +- include/acpi/acpixf.h | 3 +++ include/acpi/platform/aclinux.h | 6 ++++++ 14 files changed, 77 insertions(+), 45 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
NB: this patch is only usable with the Linaro LEG acpi.git tree. The uptream kernel does this slightly differently and a separate patch will be submitted for that tree in a different patchset.
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__ */
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduces 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 | 8 +++++++- include/acpi/acpixf.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..38c6faf 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 +#if (!ACPI_REDUCED_HARDWARE) static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,11 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#else +/* Bus master reload is not allowed in reduced HW mode. */ +static int acpi_processor_suspend(void) { return 0; } +static void acpi_processor_resume(void) { return; } +#endif /* (!ACPI_REDUCED_HARDWARE) */
static struct syscore_ops acpi_processor_syscore_ops = { .suspend = acpi_processor_suspend, @@ -617,7 +623,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) case ACPI_STATE_C2: if (!cx->address) break; - cx->valid = 1; + cx->valid = 1; break;
case ACPI_STATE_C3: diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 85bfdbe..7d393aa 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -108,6 +108,9 @@ extern u8 acpi_gbl_disable_ssdt_table_load; #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ static ACPI_INLINE prototype {}
+#define ACPI_HW_DEPENDENT_RETURN_INT(prototype) \ + static ACPI_INLINE prototype {return 0;} + #endif /* !ACPI_REDUCED_HARDWARE */
extern u32 acpi_rsdt_forced;
On 2013-11-13 11:16, 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 reduces 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 | 8 +++++++- include/acpi/acpixf.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..38c6faf 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 +#if (!ACPI_REDUCED_HARDWARE) static u32 saved_bm_rld; static int acpi_processor_suspend(void) @@ -237,6 +238,11 @@ static void acpi_processor_resume(void) acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#else +/* Bus master reload is not allowed in reduced HW mode. */ +static int acpi_processor_suspend(void) { return 0; } +static void acpi_processor_resume(void) { return; } +#endif /* (!ACPI_REDUCED_HARDWARE) */ static struct syscore_ops acpi_processor_syscore_ops = { .suspend = acpi_processor_suspend, @@ -617,7 +623,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) case ACPI_STATE_C2: if (!cx->address) break;
cx->valid = 1;
cx->valid = 1;
you fix a tailing space problem here, I think you can mention it in the change log, because at the first glance, I thought you make some mistake here :)
break;
case ACPI_STATE_C3: diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 85bfdbe..7d393aa 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -108,6 +108,9 @@ extern u8 acpi_gbl_disable_ssdt_table_load; #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ static ACPI_INLINE prototype {} +#define ACPI_HW_DEPENDENT_RETURN_INT(prototype) \
- static ACPI_INLINE prototype {return 0;}
Forgot to delete it? it is useless I think.
Thanks Hanjun
On 11/13/2013 02:08 AM, Hanjun Guo wrote:
On 2013-11-13 11:16, 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 reduces 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 | 8 +++++++- include/acpi/acpixf.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..38c6faf 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 +#if (!ACPI_REDUCED_HARDWARE) static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,11 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#else +/* Bus master reload is not allowed in reduced HW mode. */ +static int acpi_processor_suspend(void) { return 0; } +static void acpi_processor_resume(void) { return; } +#endif /* (!ACPI_REDUCED_HARDWARE) */
static struct syscore_ops acpi_processor_syscore_ops = { .suspend = acpi_processor_suspend, @@ -617,7 +623,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) case ACPI_STATE_C2: if (!cx->address) break;
cx->valid = 1;
cx->valid = 1;
you fix a tailing space problem here, I think you can mention it in the change log, because at the first glance, I thought you make some mistake here :)
Hrm. Thx. I thought I had rid myself of this but, agreed, I'll note it in the change log.
break; case ACPI_STATE_C3:
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 85bfdbe..7d393aa 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -108,6 +108,9 @@ extern u8 acpi_gbl_disable_ssdt_table_load; #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ static ACPI_INLINE prototype {}
+#define ACPI_HW_DEPENDENT_RETURN_INT(prototype) \
- static ACPI_INLINE prototype {return 0;}
Forgot to delete it? it is useless I think.
Argh. Yup, forgot to delete it. Will fix in next version.
Thanks Hanjun
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);
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; }
On 2013-11-13 11:16, al.stone@linaro.org wrote:
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)
CONFIG_X86 is definitely *not* reduced hardware, why should we change it here?
- /* 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:
[...]
- /*
* Query and parse _CRS to get the current IRQ assignment.
- /*
*/* Query and parse _CRS to get the current IRQ assignment.
[...]
Interesting, it seems that you have a auto running script to fix tailing blank problem.
I may not do that, because it will distract the attention from the patch itself.
Thanks Hanjun
On 11/13/2013 02:28 AM, Hanjun Guo wrote:
On 2013-11-13 11:16, al.stone@linaro.org wrote:
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)
CONFIG_X86 is definitely *not* reduced hardware, why should we change it here?
The reasoning is: x86 is not yet reduced HW; there are rumors that such chips are either out there or coming. In that case, there could be an x86 machine that _is_ reduced hardware and I do not want to preclude that case.
Does that make sense?
- /* 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:
[...]
- /*
* Query and parse _CRS to get the current IRQ assignment.
- /*
*/* Query and parse _CRS to get the current IRQ assignment.
[...]
Interesting, it seems that you have a auto running script to fix tailing blank problem.
I may not do that, because it will distract the attention from the patch itself.
Thanks Hanjun
Yow! Where did that come from? I'm wondering if rebase is doing something or this is more PEBKAC. I'll look into it for the next version.
On 2013-11-15 6:11, Al Stone wrote:
On 11/13/2013 02:28 AM, Hanjun Guo wrote:
On 2013-11-13 11:16, al.stone@linaro.org wrote:
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)
CONFIG_X86 is definitely *not* reduced hardware, why should we change it here?
The reasoning is: x86 is not yet reduced HW; there are rumors that such chips are either out there or coming. In that case, there could be an x86 machine that _is_ reduced hardware and I do not want to preclude that case.
Does that make sense?
Thanks for the clarify, I agree.
It is not *rumors*, they are working on it now, just have a look at the patch sent from intel, they fix some issues on reduced hardware platform:
Date: Thu, 21 Nov 2013 11:20:23 +0100 Message-ID: 87d2lu83a0.fsf@tldlab276.tl.intel.com MIME-Version: 1.0 Content-Type: text/plain --text follows this line-- Hi,
*When executing on a ACPI Hardware reduced hardware*, all the ACPI tables are not exposed in sysfs due to the fact that FACS is silently ignored by the kernel in ACPI hardware reduced and, moreover, the acpi_tables_sysfs_init ACPI table walk is buggy and stop too soon.
The acpi_tables_sysfs_init function should to rely on the appropriate acpi_status return values to decide or not to stop the iteration. This way, when running on a ACPI Reduced Harware environment where the FACS table is silently ignored by the kernel or some ACPI table are not correctly memory mapped or have a bad checksum it would not stop the iteration.
Signed-off-by: Jeremy Compostella jeremy.compostella@intel.com
--- drivers/acpi/sysfs.c | 52 ++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-)
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index fcae5fa..72a3250 100644
From: Al Stone ahs3@redhat.com
Corrected #ifdef so that DMI is not used on ARM platforms.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..b8ae608 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -512,9 +512,9 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /* - * NB: ARM does not use DMI; only older Intel products do. + * NB: ARM does not use DMI at present. * * If the machine falls into the DMI check table, * DSDT will be copied to memory
Al,
Yi Li has worked on enabling DMI Decode on ARM. This is working on v7 and most probably also on v8.
Do we need to enable this flag back?
Thanks Andrea
On Wednesday, November 13, 2013, wrote:
From: Al Stone <ahs3@redhat.com javascript:;>
Corrected #ifdef so that DMI is not used on ARM platforms.
Signed-off-by: Al Stone <al.stone@linaro.org javascript:;>
drivers/acpi/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..b8ae608 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -512,9 +512,9 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /*
* NB: ARM does not use DMI; only older Intel products do.
* NB: ARM does not use DMI at present. * * If the machine falls into the DMI check table, * DSDT will be copied to memory
-- 1.8.3.1
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org javascript:; http://lists.linaro.org/mailman/listinfo/linaro-acpi
On 11/14/2013 01:18 AM, Andrea Gallo wrote:
Al,
Yi Li has worked on enabling DMI Decode on ARM. This is working on v7 and most probably also on v8.
Do we need to enable this flag back?
Thanks Andrea
The intent was to get the core parts done up front in order to provide an upstream basis for adding DMI back in later. It's not clear this is even the correct spot for this call to occur on ARM (it's only here because that's where it was on x86).
So, once these are in, the DMI patches can layer on top.
On Wednesday, November 13, 2013, wrote:
From: Al Stone <ahs3@redhat.com <javascript:;>> Corrected #ifdef so that DMI is not used on ARM platforms. Signed-off-by: Al Stone <al.stone@linaro.org <javascript:;>> --- drivers/acpi/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..b8ae608 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -512,9 +512,9 @@ void __init acpi_early_init(void) acpi_gbl_permanent_mmap = 1; -#ifdef CONFIG_X86 +#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /* - * NB: ARM does not use DMI; only older Intel products do. + * NB: ARM does not use DMI at present. * * If the machine falls into the DMI check table, * DSDT will be copied to memory -- 1.8.3.1 _______________________________________________ Linaro-acpi mailing list Linaro-acpi@lists.linaro.org <javascript:;> http://lists.linaro.org/mailman/listinfo/linaro-acpi
-- Andrea Gallo Director, Linaro Enterprise Group email: andrea.gallo@linaro.org mailto:andrea.gallo@linaro.org mobile: +39 338 4075993 IRC: agallo@#linaro on irc.linaro.org http://irc.linaro.org Skype: agallo70
Al,
Yi Li has worked on enabling DMI Decode on ARM. This is working on v7 and most probably also on v8.
Do we need to enable this flag back?
Thanks Andrea
On Wednesday, November 13, 2013, wrote:
From: Al Stone ahs3@redhat.com
Corrected #ifdef so that DMI is not used on ARM platforms.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7fcbc6a..b8ae608 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -512,9 +512,9 @@ void __init acpi_early_init(void)
acpi_gbl_permanent_mmap = 1;
-#ifdef CONFIG_X86 +#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /*
* NB: ARM does not use DMI; only older Intel products do.
* NB: ARM does not use DMI at present. * * If the machine falls into the DMI check table, * DSDT will be copied to memory
-- 1.8.3.1
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
Hi Andrea/Al,
I set the ARM64 flag for DMI support on v8, because io_remap() can not work in dmi_scan.c , but early_memremap() can work.
I suppose we consider ACPI/EFI memory as IO range on v7, but we covert them into MEMORY type on v8.
I do not know whether you met the same problem with me on acpi_early_init(), you can try MARK's patch: https://github.com/mosalter/linux/commit/c195e4a19b4b6c92885714941cf89a21904...
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index fa0affb..0cd401c 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -786,14 +786,21 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
if (!dmi_available) return -1; - +#ifdef CONFIG_ARM64 + buf = dmi_ioremap(dmi_base, dmi_len); +#else buf = ioremap(dmi_base, dmi_len); +#endif if (buf == NULL) return -1;
dmi_table(buf, dmi_len, dmi_num, decode, private_data);
+#ifdef CONFIG_ARM64 + dmi_iounmap(buf, dmi_len); +#else iounmap(buf); +#endif return 0; } EXPORT_SYMBOL_GPL(dmi_walk);
On Thu, 2013-11-14 at 22:59 +0800, Yi Li wrote:
Hi Andrea/Al,
I set the ARM64 flag for DMI support on v8, because io_remap()
can not work in dmi_scan.c , but early_memremap() can work.
I suppose we consider ACPI/EFI memory as IO range on v7, but we
covert them into MEMORY type on v8. I do not know whether you met the same problem with me on acpi_early_init(), you can try MARK's patch: https://github.com/mosalter/linux/commit/c195e4a19b4b6c92885714941cf89a21904...
To clarify, the underlying issue is that armv7 and armv8 may not have more than one virtual mapping to a given physical page if the caching attributes differ in those mappings. x86 and ia64 don't have this restriction. At boot time, the kernel creates a cacheable mapping of all RAM pages for kernel use. The armv7 patches work around this problem by not including the areas used by uefi, dmi, acpi, etc in this kernel mapping of RAM.
So, if the dmi (or acpi) tables are in RAM which the kernel has already mapped, then neither early_ioremap() nor ioremap() are safe to use. One could get away with early_ioremap() if the area is unmapped prior to paging_init() doing the kernel RAM mapping.
The dmi caode has only been used by ia64 and x86 to date. The code has an early dmi table walk where dmi_ioremap() is used and a normal (after paging_init() is called) table walk where ioremap() is used. The ioremap on ia64 works before and after paging_init() so dmi_ioremap() is just ioremap() there. On x86, dmi_ioremap() is defined as early_ioremap().
Taking all that into account, my feeling is that using ioremap() in dmi_walk() is not correct. The mapping function is necessarily arch specific. I think the best thing to do here is to have a dmi_ioremap() for dmi_walk() and dmi_early_ioremap() for dmi_walk_early(). For armv8 this would be:
#define dmi_ioremap ioremap_cache #define dmi_early_ioremap early_memremap
And, of course:
#define dmi_iounmap iounmap #define dmi_early_iounmap early_iounmap
--Mark
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 38c6faf..93a9689 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -656,7 +656,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)
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 93a9689..e4b3a7a 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -302,7 +302,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 @@ -1001,7 +1002,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; @@ -1056,7 +1058,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 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index b8ae608..9215cc6 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 !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) && (!ACPI_REDUCED_HARDWARE) /* NB: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */
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 | 10 ---------- arch/arm64/include/asm/acpi.h | 10 ---------- drivers/acpi/plat/arm/boot.c | 2 ++ 3 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h index ca7efaa..651a15c 100644 --- a/arch/arm/include/asm/acpi.h +++ b/arch/arm/include/asm/acpi.h @@ -82,17 +82,7 @@ /* Blob handling macros */ #define ACPI_BLOB_HEADER_SIZE 8
-int __acpi_acquire_global_lock(unsigned int *lock); -int __acpi_release_global_lock(unsigned int *lock); - -#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \ - ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ - ((Acq) = __acpi_release_global_lock(&facs->global_lock)) - /* 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..8dc632a 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -60,17 +60,7 @@ /* Blob handling macros */ #define ACPI_BLOB_HEADER_SIZE 8
-int __acpi_acquire_global_lock(unsigned int *lock); -int __acpi_release_global_lock(unsigned int *lock); - -#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \ - ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ - ((Acq) = __acpi_release_global_lock(&facs->global_lock)) - /* 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