aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-07-02 04:54:01 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-07-02 04:54:01 -0400
commit29cb3cd208dd0e4471bb80bec4facc49ceb199fa (patch)
tree035128bf7af997d5e1e5208c900ba78c5a1df46d /arch/arm/include
parentcbe263497def23befb6f475977661bae5d1f82e4 (diff)
ARM: pm: allow suspend finisher to return error codes
There are SoCs where attempting to enter a low power state is ignored, and the CPU continues executing instructions with all state preserved. It is over-complex at that point to disable the MMU just to call the resume path. Instead, allow the suspend finisher to return error codes to abort suspend in this circumstance, where the cpu_suspend internals will then unwind the saved state on the stack. Also omit the tlb flush as no changes to the page tables will have happened. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/suspend.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
index f8db9d096bc7..b0e4e1a02318 100644
--- a/arch/arm/include/asm/suspend.h
+++ b/arch/arm/include/asm/suspend.h
@@ -10,12 +10,13 @@ extern void cpu_resume(void);
10 * Hide the first two arguments to __cpu_suspend - these are an implementation 10 * Hide the first two arguments to __cpu_suspend - these are an implementation
11 * detail which platform code shouldn't have to know about. 11 * detail which platform code shouldn't have to know about.
12 */ 12 */
13static inline void cpu_suspend(unsigned long arg, void (*fn)(unsigned long)) 13static inline int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
14{ 14{
15 extern void __cpu_suspend(int, long, unsigned long, 15 extern int __cpu_suspend(int, long, unsigned long,
16 void (*)(unsigned long)); 16 int (*)(unsigned long));
17 __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn); 17 int ret = __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn);
18 flush_tlb_all(); 18 flush_tlb_all();
19 return ret;
19} 20}
20 21
21#endif 22#endif