diff mbox

[v3,part1,06/11] ARM64 / ACPI: Introduce lowlevel suspend function

Message ID 1398432017-8506-7-git-send-email-hanjun.guo@linaro.org
State New
Headers show

Commit Message

Hanjun Guo April 25, 2014, 1:20 p.m. UTC
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 |    4 ++++
 drivers/acpi/plat/arm-core.c  |    7 +++++++
 2 files changed, 11 insertions(+)

Comments

Lorenzo Pieralisi April 28, 2014, 3:22 p.m. UTC | #1
On Fri, Apr 25, 2014 at 02:20:12PM +0100, Hanjun Guo wrote:
> 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 |    4 ++++
>  drivers/acpi/plat/arm-core.c  |    7 +++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
> index 3ac9dfb..60e3a72 100644
> --- a/arch/arm64/include/asm/acpi.h
> +++ b/arch/arm64/include/asm/acpi.h
> @@ -85,6 +85,10 @@ static inline void acpi_disable_pci(void)
>   */ 
>  #define cpu_physical_id(cpu) -1
>  
> +/* Low-level suspend routine. */
> +extern int (*acpi_suspend_lowlevel)(void);
> +#define acpi_wakeup_address (0)

I understand you want code to compile, but as I mentioned in another
thread, I would focus more on understanding if these macros/hooks are
really needed for ARM rather than defining them _just_ to make code
compile. The fact that you are forced to define them makes me think
there is something to be changed in ACPI core code instead of adding
empty and probably useless macros/hooks for ARM which I have no idea
whatsoever whether will ever be needed or not.

Lorenzo

--
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
Hanjun Guo April 29, 2014, 8:46 a.m. UTC | #2
Hi Lorenzo,

On 2014-4-28 23:22, Lorenzo Pieralisi wrote:
> On Fri, Apr 25, 2014 at 02:20:12PM +0100, Hanjun Guo wrote:
>> 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.
>>
[...]
>>  #define cpu_physical_id(cpu) -1
>>  
>> +/* Low-level suspend routine. */
>> +extern int (*acpi_suspend_lowlevel)(void);
>> +#define acpi_wakeup_address (0)
> 
> I understand you want code to compile, but as I mentioned in another
> thread, I would focus more on understanding if these macros/hooks are
> really needed for ARM rather than defining them _just_ to make code
> compile. The fact that you are forced to define them makes me think
> there is something to be changed in ACPI core code instead of adding
> empty and probably useless macros/hooks for ARM which I have no idea
> whatsoever whether will ever be needed or not.

Ok, we will deep into ACPI core to find out how to handle it, thanks
for your suggestion.

Hanjun

--
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 3ac9dfb..60e3a72 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -85,6 +85,10 @@  static inline void acpi_disable_pci(void)
  */ 
 #define cpu_physical_id(cpu) -1
 
+/* Low-level suspend routine. */
+extern int (*acpi_suspend_lowlevel)(void);
+#define acpi_wakeup_address (0)
+
 #endif /* CONFIG_ACPI */
 
 #endif /*_ASM_ACPI_H*/
diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c
index e4846fd..aeea64e 100644
--- a/drivers/acpi/plat/arm-core.c
+++ b/drivers/acpi/plat/arm-core.c
@@ -129,3 +129,10 @@  static int __init parse_acpi(char *arg)
 	return 0;
 }
 early_param("acpi", parse_acpi);
+
+/*
+ * acpi_suspend_lowlevel() - save kernel state and suspend.
+ *
+ * TBD when ARM/ARM64 starts to support suspend...
+ */
+int (*acpi_suspend_lowlevel)(void);