diff mbox

[v3,03/17] ARM64 / ACPI: Introduce lowlevel suspend function

Message ID 1409583475-6978-4-git-send-email-hanjun.guo@linaro.org
State New
Headers show

Commit Message

Hanjun Guo Sept. 1, 2014, 2:57 p.m. UTC
From: Graeme Gregory <graeme.gregory@linaro.org>

acpi_wakeup_address is used on x86 as the address bios jumps into
when machine wakes up from suspend. As arm64 does not have such a
bios this mechanism will be provided by other means. But the define
is still required inside the acpi core.

Introduce a null stub for acpi_suspend_lowlevel as this is also
required by core. This will be filled in when standards are
defined for arm64 ACPI global power states.

Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 arch/arm64/include/asm/acpi.h |   12 ++++++++++++
 arch/arm64/kernel/acpi.c      |    7 +++++++
 2 files changed, 19 insertions(+)

Comments

Catalin Marinas Sept. 9, 2014, 4:35 p.m. UTC | #1
On Mon, Sep 01, 2014 at 03:57:41PM +0100, Hanjun Guo wrote:
> From: Graeme Gregory <graeme.gregory@linaro.org>
> 
> acpi_wakeup_address is used on x86 as the address bios jumps into
> when machine wakes up from suspend. As arm64 does not have such a
> bios this mechanism will be provided by other means. But the define
> is still required inside the acpi core.
> 
> Introduce a null stub for acpi_suspend_lowlevel as this is also
> required by core. This will be filled in when standards are
> defined for arm64 ACPI global power states.

Do we actually plan to use these on arm64? I'm worried most of these
don't make sense on arm64 (the aim is to use PSCI). Is it possible to
refactor the core code so that we don't have to define dummy macros or
variables just to be able to build the kernel?
Graeme Gregory Sept. 9, 2014, 10:04 p.m. UTC | #2
On Tue, Sep 09, 2014 at 05:35:29PM +0100, Catalin Marinas wrote:
> On Mon, Sep 01, 2014 at 03:57:41PM +0100, Hanjun Guo wrote:
> > From: Graeme Gregory <graeme.gregory@linaro.org>
> > 
> > acpi_wakeup_address is used on x86 as the address bios jumps into
> > when machine wakes up from suspend. As arm64 does not have such a
> > bios this mechanism will be provided by other means. But the define
> > is still required inside the acpi core.
> > 
> > Introduce a null stub for acpi_suspend_lowlevel as this is also
> > required by core. This will be filled in when standards are
> > defined for arm64 ACPI global power states.
> 
> Do we actually plan to use these on arm64? I'm worried most of these
> don't make sense on arm64 (the aim is to use PSCI). Is it possible to
> refactor the core code so that we don't have to define dummy macros or
> variables just to be able to build the kernel?
> 
Currently ia64 does the same as this for stubbing out the functions.

We did investigate removing the code but that ultimately ended with more
functions and variables stubbed then this.

Graeme

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 8b837ab..02bbb0b 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -40,6 +40,18 @@  static inline bool acpi_has_cpu_in_madt(void)
 
 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
 
+/* Low-level suspend routine.
+ *
+ * ACPI S-states for ARM64 have to be defined
+ * and approved before doing anything else, maybe
+ * we need update the ACPI spec, here we
+ * just introduce function and macro needed by
+ * ACPI core as IA64 did, and revisit them when
+ * the spec is ready.
+ */
+extern int (*acpi_suspend_lowlevel)(void);
+#define acpi_wakeup_address 0
+
 #endif /* CONFIG_ACPI */
 
 #endif /*_ASM_ACPI_H*/
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 9252f72..b6940a0 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -67,3 +67,10 @@  void __init acpi_boot_table_init(void)
 	if (acpi_table_init())
 		disable_acpi();
 }
+
+/*
+ * acpi_suspend_lowlevel() - save kernel state and suspend.
+ *
+ * TBD when ARM/ARM64 starts to support suspend...
+ */
+int (*acpi_suspend_lowlevel)(void) = NULL;