Skip to contentSkip to conversation

ARM: Add initial hibernation support

RFC PATCH In review Hiroshi DOYU 7 participants 36 messages Jun 30, 2010 – Nov 26, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ARM: Add initial hibernation support

This is the experimental patch to add hibernation (a.k.a:
Suspend-To-Disk) support for ARM architecutre.

Presently it seems to work with OMAP3, and apparently it still needs more efforts to make it enough stable and to support other ARM platforms cleanly but I am sending this patch to get some feedbacks at its early phase to find out the further direction. It would be really appreciated if you give some comment on this.

This patch is based on the one sent to loml(*1) by Teerth Reddy, which was originally from Romit and Raghu at TI.

    *1: https://patchwork.kernel.org/patch/96442/

Hiroshi DOYU (1):
ARM: Add initial hibernation support

 arch/arm/Kconfig                |    4 +
 arch/arm/include/asm/memory.h   |    1 +
 arch/arm/include/asm/suspend.h  |    6 +
 arch/arm/kernel/Makefile        |    1 +
 arch/arm/kernel/hibernate.c     |  234 +++++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/hibernate_asm.S |  135 ++++++++++++++++++++++
 arch/arm/kernel/vmlinux.lds.S   |    3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S
#1 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

---
 arch/arm/Kconfig                |    4 +
 arch/arm/include/asm/memory.h   |    1 +
 arch/arm/include/asm/suspend.h  |    6 +
 arch/arm/kernel/Makefile        |    1 +
 arch/arm/kernel/hibernate.c     |  234 +++++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/hibernate_asm.S |  135 ++++++++++++++++++++++
 arch/arm/kernel/vmlinux.lds.S   |    3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S
arch/arm/Kconfig +4 -0
index 1f254bd..c19a206 100644
@@ -189,6 +189,10 @@ config VECTORS_BASE
 	help
 	  The base address of exception vectors.
 
+config ARCH_HIBERNATION_POSSIBLE
+	def_bool y
+	depends on CPU_V7 && !SMP
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
arch/arm/include/asm/memory.h +1 -0
index 4312ee5..cd49706 100644
@@ -194,6 +194,7 @@ static inline void *phys_to_virt(unsigned long x)
  */
 #define __pa(x)			__virt_to_phys((unsigned long)(x))
 #define __va(x)			((void *)__phys_to_virt((unsigned long)(x)))
+#define __pa_symbol(x)		__pa(RELOC_HIDE((unsigned long)(x),0))
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
 
 /*
arch/arm/include/asm/suspend.h new file +6 -0
new file mode 100644
index 0000000..8857c79
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARM_SUSPEND_H
+#define __ASM_ARM_SUSPEND_H
+
+static inline int arch_prepare_suspend(void) { return 0; }
+
+#endif	/* __ASM_ARM_SUSPEND_H */
arch/arm/kernel/Makefile +1 -0
index 26d302c..38a0b10 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE)	+= thumbee.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_ARM_UNWIND)	+= unwind.o
 obj-$(CONFIG_HAVE_TCM)		+= tcm.o
+obj-$(CONFIG_HIBERNATION)       += hibernate.o hibernate_asm.o
 
 obj-$(CONFIG_CRUNCH)		+= crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o		:= -Wa,-mcpu=ep9312
arch/arm/kernel/hibernate.c new file +234 -0

234 lines not on this page · raw message

arch/arm/kernel/hibernate_asm.S new file +135 -0

135 lines not on this page · raw message

arch/arm/kernel/vmlinux.lds.S +2 -1
index b16c079..799c79c 100644
@@ -149,7 +149,6 @@ SECTIONS
 		__init_end = .;
 #endif
 
-		NOSAVE_DATA
 		CACHELINE_ALIGNED_DATA(32)
 
 		/*
@@ -172,6 +171,8 @@ SECTIONS
 	}
 	_edata_loc = __data_loc + SIZEOF(.data);
 
+	NOSAVE_DATA
+
 #ifdef CONFIG_HAVE_TCM
         /*
 	 * We align everything to a page boundary so we can
Signature · 1 line
1.7.1.rc2
#2 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Hi!

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Looks ok to me. ACK.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: ext Pavel Machek <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Wed, 14 Jul 2010 15:22:55 +0200

Quoted 6 lines

Hi!

Quoted 4 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Quoted 8 lines
Quoted 6 lines

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Looks ok to me. ACK.

Pavel, Thanks.

Russell, would it be possible to put this into your next merge queue?

#4 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Quoted 1 line · Hiroshi DOYU

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

#5 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 9 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

#6 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

#7 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Hiroshi,

Quoted 39 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Russell King - ARM Linux
Sent: Friday, July 16, 2010 1:23 PM
To: Hiroshi DOYU
Cc: linux-arm-kernel at lists.infradead.org; pavel at ucw.cz; khilman at deeprootsystems.com; Reddy, Teerth; linux-pm at lists.linux- foundation.org; Yoshiya.Hirase at nokia.com; linux-omap at vger.kernel.org
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support

Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

Quoted 8 lines

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

When this getting developed in TI, we had one more concern about handling the trustzone part for the CP15 resgiters.
This patch will hang on restoration on some devices implementing trustzone.

Regards,
Santosh

#8 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: "ext Shilimkar, Santosh" <[email protected]>
Subject: RE: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 10:48:00 +0200

Quoted 45 lines

Hiroshi,

Quoted 44 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Russell King - ARM Linux
Sent: Friday, July 16, 2010 1:23 PM
To: Hiroshi DOYU
Cc: linux-arm-kernel at lists.infradead.org; pavel at ucw.cz; khilman at deeprootsystems.com; Reddy, Teerth; linux-pm at lists.linux- foundation.org; Yoshiya.Hirase at nokia.com; linux-omap at vger.kernel.org
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support

Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Quoted 6 lines
Quoted 3 lines

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

When this getting developed in TI, we had one more concern about handling the trustzone part for the CP15 resgiters.
This patch will hang on restoration on some devices implementing trustzone.

Thanks for the info.

I think that this trustzone issue and PXA part can be revisited later once the basic stuff is accepted.

#9 lore raw
In reply to Shilimkar, Santosh

From: "ext Shilimkar, Santosh" <[email protected]>
Subject: RE: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 10:48:00 +0200

Quoted 45 lines

Hiroshi,

Quoted 44 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Russell King - ARM Linux
Sent: Friday, July 16, 2010 1:23 PM
To: Hiroshi DOYU
Cc: [email protected]; [email protected]; [email protected]; Reddy, Teerth; [email protected] foundation.org; [email protected]; [email protected]
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support

Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Quoted 6 lines
Quoted 3 lines

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

When this getting developed in TI, we had one more concern about handling the trustzone part for the CP15 resgiters.
This patch will hang on restoration on some devices implementing trustzone.

Thanks for the info.

I think that this trustzone issue and PXA part can be revisited later once the basic stuff is accepted.

#10 lore raw
In reply to Russell King - ARM Linux

Hiroshi,

Quoted 39 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Russell King - ARM Linux
Sent: Friday, July 16, 2010 1:23 PM
To: Hiroshi DOYU
Cc: [email protected]; [email protected]; [email protected]; Reddy, Teerth; [email protected] foundation.org; [email protected]; [email protected]
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support

Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

Quoted 8 lines

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

When this getting developed in TI, we had one more concern about handling the trustzone part for the CP15 resgiters.
This patch will hang on restoration on some devices implementing trustzone.

Regards,
Santosh

#11 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

In reply to Russell King - ARM Linux

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 09:52:44 +0200

Quoted 29 lines · Hiroshi DOYU
Quoted 11 lines

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

Quoted 7 lines

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

Ok, it seems to be the way to try to make use of the existing one for suspend-to-ram with some modifications.

#12 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Quoted 38 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 09:52:44 +0200

Quoted 34 lines · Hiroshi DOYU
Quoted 11 lines

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Quoted 5 lines
Quoted 2 lines

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

Ok, it seems to be the way to try to make use of the existing one for suspend-to-ram with some modifications.

[sorry to be late to the party here]

At least on OMAP, we already have everything needed to save/restore context for off-mode transitions handled in the suspend (and idle) paths. So, at least in terms of context save/restore, there should be minimal changes needed there.

Kevin

#13 lore raw
In reply to Hiroshi DOYU
Quoted 38 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 09:52:44 +0200

Quoted 34 lines · Hiroshi DOYU
Quoted 11 lines

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Quoted 5 lines
Quoted 2 lines

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

Ok, it seems to be the way to try to make use of the existing one for suspend-to-ram with some modifications.

[sorry to be late to the party here]

At least on OMAP, we already have everything needed to save/restore context for off-mode transitions handled in the suspend (and idle) paths. So, at least in terms of context save/restore, there should be minimal changes needed there.

Kevin

#14 lore raw
In reply to Russell King - ARM Linux

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 09:52:44 +0200

Quoted 29 lines · Hiroshi DOYU
Quoted 11 lines

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

Quoted 7 lines

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

Ok, it seems to be the way to try to make use of the existing one for suspend-to-ram with some modifications.

#15 lore raw
In reply to Hiroshi DOYU
Quoted 11 lines · Hiroshi DOYU

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 7 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Quoted 5 lines
Quoted 2 lines

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM arch specs.

Quoted 7 lines
Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume support. This code already saves the necessary state from CP15 and any other state which needs to be saved prior to putting the system into low power mode.

Every machine class which supports suspend today has their own chunk of code which does this, normally called something like sleep.S

#16 lore raw
In reply to Russell King - ARM Linux

From: ext Russell King - ARM Linux <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

Quoted 9 lines · Hiroshi DOYU
Quoted 1 line

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

Right. This arch specific part can be something like "suspend-v[3-7].S" to accomodate those differences

Quoted 5 lines

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

Could you explain which code you're refering for the existing one?

#17 lore raw
In reply to Hiroshi DOYU
Quoted 1 line · Hiroshi DOYU

Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all those CP15 register accesses there - that's asking for lots of ifdefs to spring up as more CPUs are supported.

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is properly restored?

We already have code which knows what needs to be saved across a power-off transition - its what we use for our normal suspend/resume functionality, so we should look at re-using that code for hibernate as well. We really don't want to be maintaining two sets of code doing the same thing.

#18 lore raw
In reply to Pavel Machek

From: ext Pavel Machek <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Wed, 14 Jul 2010 15:22:55 +0200

Quoted 6 lines

Hi!

Quoted 4 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Quoted 8 lines
Quoted 6 lines

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Looks ok to me. ACK.

Pavel, Thanks.

Russell, would it be possible to put this into your next merge queue?

#19 lore raw
In reply to Hiroshi DOYU

Hi!

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Looks ok to me. ACK.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#20 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

In reply to Hiroshi DOYU

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

Thanks

#21 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 7 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

#22 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Dne ?t 15. ?ervence 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 16 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 12 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Quoted 7 lines
Quoted 2 lines

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

Sorry for stupid questions :)

#23 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 20 lines

Dne ?t 15. ?ervence 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 19 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 14 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

Quoted 6 lines
Quoted 4 lines

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

#24 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Dne ?t 15. ?ervence 2010 08:00:28 Hiroshi DOYU napsal(a):

Quoted 26 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 22 lines

Dne ?t 15. ?ervence 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 21 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 6 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.

#25 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Dne ?t 15. ?ervence 2010 08:04:06 Marek Vasut napsal(a):

Quoted 30 lines

Dne ?t 15. ?ervence 2010 08:00:28 Hiroshi DOYU napsal(a):

Quoted 29 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 25 lines

Dne ?t 15. ?ervence 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 23 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 6 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.

Sorry I wasn't able to test this yet, I'm having trouble with my cross- toolchain.

#26 lore raw
In reply to Marek Vasut

Dne Čt 15. července 2010 08:04:06 Marek Vasut napsal(a):

Quoted 30 lines

Dne Čt 15. července 2010 08:00:28 Hiroshi DOYU napsal(a):

Quoted 29 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 25 lines

Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 23 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 6 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.

Sorry I wasn't able to test this yet, I'm having trouble with my cross- toolchain.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#28 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

Quoted 36 lines · On Tuesday 02 November 2010 13:16:06 Michael Trimarchi wrote:

Hi Marek

Quoted 33 lines · Marek Vasut

Dne ?t 15. ?ervence 2010 08:00:28 Hiroshi DOYU napsal(a):

Quoted 32 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 27 lines

Dne ?t 15. ?ervence 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 16 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 12 lines

Dne St 30. ?ervna 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Quoted 7 lines
Quoted 2 lines

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

No, I don't think so. The resuming boot could set up most of states basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.

Have you done some test on pxa/xscale family?

Hi, didn't get the chance yet, but I believe there'll be need for changes in this stuff ... did anything new happen on the list about this ?

I'd suggest you to take this up on the list again.

NOTE: You'll also need to adjust this stuff for armv5 core and maybe even for xscale core.

Cheers

Quoted 8 lines

Michael Trimarchi

Quoted 5 lines

--

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

#29 lore raw
In reply to Hiroshi DOYU

Dne Čt 15. července 2010 08:00:28 Hiroshi DOYU napsal(a):

Quoted 26 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 22 lines

Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 21 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 6 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.

#30 lore raw
In reply to Marek Vasut

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

Quoted 20 lines

Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 19 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 14 lines

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

Quoted 6 lines
Quoted 4 lines

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.

#31 lore raw
In reply to Hiroshi DOYU

Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):

Quoted 16 lines

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 12 lines

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Quoted 7 lines
Quoted 2 lines

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

I see ... do I need any special support on the bootloader or userland side ?

Sorry for stupid questions :)

#32 lore raw
In reply to Marek Vasut

From: ext Marek Vasut <[email protected]>
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

Quoted 8 lines

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 7 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

Quoted 7 lines
Quoted 3 lines

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I guess.

#33 lore raw
In reply to Hiroshi DOYU

Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):

Quoted 10 lines

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd make that impossible?

Thanks
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

#34 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

In reply to Hiroshi DOYU
Quoted 10 lines · Hiroshi DOYU

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

(snip)

Quoted 4 lines
arch/arm/Kconfig +4 -0
+config ARCH_HIBERNATION_POSSIBLE
+ ? ? ? def_bool y
+ ? ? ? depends on CPU_V7 && !SMP
+

(snip)

Quoted 3 lines

+/*
+ * FIXME: Only support for Cortex A8 now
+ */

(snip)

Quoted 16 lines
arch/arm/kernel/vmlinux.lds.S +0 -0
@@ -149,7 +149,6 @@ SECTIONS
 ? ? ? ? ? ? ? ?__init_end = .;

?#endif

- ? ? ? ? ? ? ? NOSAVE_DATA
? ? ? ? ? ? ? ?CACHELINE_ALIGNED_DATA(32)

? ? ? ? ? ? ? ?/*

arch/arm/kernel/vmlinux.lds.S +2 -0
@@ -172,6 +171,8 @@ SECTIONS
 ? ? ? ?}
 ? ? ? ?_edata_loc = __data_loc + SIZEOF(.data);
 
+ ? ? ? NOSAVE_DATA
+
Quoted 4 lines

?#ifdef CONFIG_HAVE_TCM
? ? ? ? /*
? ? ? ? * We align everything to a page boundary so we can --

I have been working on the hibernation feature on S5PC210 (ARM Cortex A9 MP-Core) based on this patch and it's working find with minor modifications. (and will send as soon as clutters are removed and tested further)

However, I've got a question on your patch: is it really necessary to patch [arch/arm/kernel/vmlinux.lds.S] file? Without patching that file, it works fine at my system (although it's based on 2.6.36, not 37 rc #) and with that patch, the linker spits an error. If it's necessary to patch [arch/arm/kernel/vmlinux.lds.S], could you please explain a bit about it?

Thank you.

- MyungJoo

Quoted 8 lines

1.7.1.rc2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 5 lines
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
#35 lore raw
In reply to Hiroshi DOYU
Quoted 10 lines · Hiroshi DOYU

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

(snip)

Quoted 4 lines
arch/arm/Kconfig +4 -0
+config ARCH_HIBERNATION_POSSIBLE
+       def_bool y
+       depends on CPU_V7 && !SMP
+

(snip)

Quoted 3 lines

+/*
+ * FIXME: Only support for Cortex A8 now
+ */

(snip)

Quoted 11 lines
arch/arm/kernel/vmlinux.lds.S +0 -1
@@ -149,7 +149,6 @@ SECTIONS
                __init_end = .;
  #endif
 
-               NOSAVE_DATA
                CACHELINE_ALIGNED_DATA(32)
 
                /*

arch/arm/kernel/vmlinux.lds.S SECTIONS

Quoted 9 lines
arch/arm/kernel/vmlinux.lds.S +2 -1
@@ -172,6 +171,8 @@ SECTIONS
        }
        _edata_loc = __data_loc + SIZEOF(.data);
 
+       NOSAVE_DATA
+
  #ifdef CONFIG_HAVE_TCM
         /*
         * We align everything to a page boundary so we can
--

I have been working on the hibernation feature on S5PC210 (ARM Cortex A9 MP-Core) based on this patch and it's working find with minor modifications. (and will send as soon as clutters are removed and tested further)

However, I've got a question on your patch: is it really necessary to patch [arch/arm/kernel/vmlinux.lds.S] file? Without patching that file, it works fine at my system (although it's based on 2.6.36, not 37 rc #) and with that patch, the linker spits an error. If it's necessary to patch [arch/arm/kernel/vmlinux.lds.S], could you please explain a bit about it?

Thank you.

- MyungJoo

Quoted 8 lines

1.7.1.rc2

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 5 lines
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
#36 lore raw

RFC PATCH 1/1 ARM: Add initial hibernation support

In reply to Hiroshi DOYU

From: Hiroshi DOYU <[email protected]>

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original patch(*1) was sent to LOML by Teerth Reddy <[email protected]>

*1: https://patchwork.kernel.org/patch/96442/

---
 arch/arm/Kconfig                |    4 +
 arch/arm/include/asm/memory.h   |    1 +
 arch/arm/include/asm/suspend.h  |    6 +
 arch/arm/kernel/Makefile        |    1 +
 arch/arm/kernel/hibernate.c     |  234 +++++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/hibernate_asm.S |  135 ++++++++++++++++++++++
 arch/arm/kernel/vmlinux.lds.S   |    3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S
arch/arm/Kconfig +4 -0
index 1f254bd..c19a206 100644
@@ -189,6 +189,10 @@ config VECTORS_BASE
 	help
 	  The base address of exception vectors.
 
+config ARCH_HIBERNATION_POSSIBLE
+	def_bool y
+	depends on CPU_V7 && !SMP
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
arch/arm/include/asm/memory.h +1 -0
index 4312ee5..cd49706 100644
@@ -194,6 +194,7 @@ static inline void *phys_to_virt(unsigned long x)
  */
 #define __pa(x)			__virt_to_phys((unsigned long)(x))
 #define __va(x)			((void *)__phys_to_virt((unsigned long)(x)))
+#define __pa_symbol(x)		__pa(RELOC_HIDE((unsigned long)(x),0))
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
 
 /*
arch/arm/include/asm/suspend.h new file +6 -0
new file mode 100644
index 0000000..8857c79
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARM_SUSPEND_H
+#define __ASM_ARM_SUSPEND_H
+
+static inline int arch_prepare_suspend(void) { return 0; }
+
+#endif	/* __ASM_ARM_SUSPEND_H */
arch/arm/kernel/Makefile +1 -0
index 26d302c..38a0b10 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE)	+= thumbee.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_ARM_UNWIND)	+= unwind.o
 obj-$(CONFIG_HAVE_TCM)		+= tcm.o
+obj-$(CONFIG_HIBERNATION)       += hibernate.o hibernate_asm.o
 
 obj-$(CONFIG_CRUNCH)		+= crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o		:= -Wa,-mcpu=ep9312
arch/arm/kernel/hibernate.c new file +234 -0

234 lines not on this page · raw message

arch/arm/kernel/hibernate_asm.S new file +135 -0

135 lines not on this page · raw message

arch/arm/kernel/vmlinux.lds.S +2 -1
index b16c079..799c79c 100644
@@ -149,7 +149,6 @@ SECTIONS
 		__init_end = .;
 #endif
 
-		NOSAVE_DATA
 		CACHELINE_ALIGNED_DATA(32)
 
 		/*
@@ -172,6 +171,8 @@ SECTIONS
 	}
 	_edata_loc = __data_loc + SIZEOF(.data);
 
+	NOSAVE_DATA
+
 #ifdef CONFIG_HAVE_TCM
         /*
 	 * We align everything to a page boundary so we can
Signature · 1 line
1.7.1.rc2