diff options
author | Abhilash Kesavan <a.kesavan@samsung.com> | 2013-01-25 13:40:19 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-01-31 01:28:05 -0500 |
commit | d3fcacf52d24ff1b12d994d9ddb7496f651294a2 (patch) | |
tree | 551b22ecd840f7ad76d0f057de2db1d1c8be1437 /arch | |
parent | 8baaa265c5e8e378cb60164f47e24bf296a6d685 (diff) |
ARM: SAMSUNG: Gracefully exit on suspend failure
As per the Exynos5250 User Manual:
When there are pending interrupt events, WFI/WFE instruction are
ignored. To cancel the power-down sequence follow these steps:
1) Disable system power-down using CENTRAL_SEQ_CONFIGURATION register
2) Clear WAKEUP_STAT register
3) Enable interrupt service routine for CPU
Code for early wakeup for exynos already exists. Remove the panic
on suspend failure, clear the wakeup state register and return 1
from cpu_suspend to indicate a failed suspend (to a user daemon).
Older Samsung SoCs have similar panics and I have removed them all.
Haven't touched the S3C2410 sleep code.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos/pm.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/pm-s3c2412.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/pm-s3c2416.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/pm.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/pm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/pm.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/pm.c | 5 |
7 files changed, 18 insertions, 10 deletions
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index b9b539cac81e..5106ab83e593 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -91,8 +91,8 @@ static int exynos_cpu_suspend(unsigned long arg) | |||
91 | /* issue the standby signal into the pm unit. */ | 91 | /* issue the standby signal into the pm unit. */ |
92 | cpu_do_idle(); | 92 | cpu_do_idle(); |
93 | 93 | ||
94 | /* we should never get past here */ | 94 | pr_info("Failed to suspend the system\n"); |
95 | panic("sleep resumed to originator?"); | 95 | return 1; /* Aborting suspend */ |
96 | } | 96 | } |
97 | 97 | ||
98 | static void exynos_pm_prepare(void) | 98 | static void exynos_pm_prepare(void) |
@@ -282,6 +282,8 @@ static void exynos_pm_resume(void) | |||
282 | if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) { | 282 | if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) { |
283 | tmp |= S5P_CENTRAL_LOWPWR_CFG; | 283 | tmp |= S5P_CENTRAL_LOWPWR_CFG; |
284 | __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); | 284 | __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); |
285 | /* clear the wakeup state register */ | ||
286 | __raw_writel(0x0, S5P_WAKEUP_STAT); | ||
285 | /* No need to perform below restore code */ | 287 | /* No need to perform below restore code */ |
286 | goto early_wakeup; | 288 | goto early_wakeup; |
287 | } | 289 | } |
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2412.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c index c60f67a75aff..f5dc2b254a5a 100644 --- a/arch/arm/mach-s3c24xx/pm-s3c2412.c +++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c | |||
@@ -48,7 +48,8 @@ static int s3c2412_cpu_suspend(unsigned long arg) | |||
48 | 48 | ||
49 | s3c2412_sleep_enter(); | 49 | s3c2412_sleep_enter(); |
50 | 50 | ||
51 | panic("sleep resumed to originator?"); | 51 | pr_info("Failed to suspend the system\n"); |
52 | return 1; /* Aborting suspend */ | ||
52 | } | 53 | } |
53 | 54 | ||
54 | static void s3c2412_pm_prepare(void) | 55 | static void s3c2412_pm_prepare(void) |
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2416.c b/arch/arm/mach-s3c24xx/pm-s3c2416.c index 1bd4817b8eb8..1a9e8dd194ff 100644 --- a/arch/arm/mach-s3c24xx/pm-s3c2416.c +++ b/arch/arm/mach-s3c24xx/pm-s3c2416.c | |||
@@ -34,7 +34,8 @@ static int s3c2416_cpu_suspend(unsigned long arg) | |||
34 | 34 | ||
35 | s3c2412_sleep_enter(); | 35 | s3c2412_sleep_enter(); |
36 | 36 | ||
37 | panic("sleep resumed to originator?"); | 37 | pr_info("Failed to suspend the system\n"); |
38 | return 1; /* Aborting suspend */ | ||
38 | } | 39 | } |
39 | 40 | ||
40 | static void s3c2416_pm_prepare(void) | 41 | static void s3c2416_pm_prepare(void) |
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index 7feb426fc202..54d48b857f70 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c | |||
@@ -296,7 +296,8 @@ static int s3c64xx_cpu_suspend(unsigned long arg) | |||
296 | 296 | ||
297 | /* we should never get past here */ | 297 | /* we should never get past here */ |
298 | 298 | ||
299 | panic("sleep resumed to originator?"); | 299 | pr_info("Failed to suspend the system\n"); |
300 | return 1; /* Aborting suspend */ | ||
300 | } | 301 | } |
301 | 302 | ||
302 | /* mapping of interrupts to parts of the wakeup mask */ | 303 | /* mapping of interrupts to parts of the wakeup mask */ |
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c index 9cba18bfe47b..97c2a08ad490 100644 --- a/arch/arm/mach-s5p64x0/pm.c +++ b/arch/arm/mach-s5p64x0/pm.c | |||
@@ -103,8 +103,8 @@ static int s5p64x0_cpu_suspend(unsigned long arg) | |||
103 | "mcr p15, 0, %0, c7, c10, 4\n\t" | 103 | "mcr p15, 0, %0, c7, c10, 4\n\t" |
104 | "mcr p15, 0, %0, c7, c0, 4" : : "r" (tmp)); | 104 | "mcr p15, 0, %0, c7, c0, 4" : : "r" (tmp)); |
105 | 105 | ||
106 | /* we should never get past here */ | 106 | pr_info("Failed to suspend the system\n"); |
107 | panic("sleep resumed to originator?"); | 107 | return 1; /* Aborting suspend */ |
108 | } | 108 | } |
109 | 109 | ||
110 | /* mapping of interrupts to parts of the wakeup mask */ | 110 | /* mapping of interrupts to parts of the wakeup mask */ |
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 736bfb103cbc..2b68a67b6e95 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c | |||
@@ -104,8 +104,8 @@ static int s5pv210_cpu_suspend(unsigned long arg) | |||
104 | "mcr p15, 0, %0, c7, c10, 4\n\t" | 104 | "mcr p15, 0, %0, c7, c10, 4\n\t" |
105 | "wfi" : : "r" (tmp)); | 105 | "wfi" : : "r" (tmp)); |
106 | 106 | ||
107 | /* we should never get past here */ | 107 | pr_info("Failed to suspend the system\n"); |
108 | panic("sleep resumed to originator?"); | 108 | return 1; /* Aborting suspend */ |
109 | } | 109 | } |
110 | 110 | ||
111 | static void s5pv210_pm_prepare(void) | 111 | static void s5pv210_pm_prepare(void) |
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index d896add68ad3..002b1472293b 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c | |||
@@ -243,6 +243,7 @@ int (*pm_cpu_sleep)(unsigned long); | |||
243 | 243 | ||
244 | static int s3c_pm_enter(suspend_state_t state) | 244 | static int s3c_pm_enter(suspend_state_t state) |
245 | { | 245 | { |
246 | int ret; | ||
246 | /* ensure the debug is initialised (if enabled) */ | 247 | /* ensure the debug is initialised (if enabled) */ |
247 | 248 | ||
248 | s3c_pm_debug_init(); | 249 | s3c_pm_debug_init(); |
@@ -300,7 +301,9 @@ static int s3c_pm_enter(suspend_state_t state) | |||
300 | * we resume as it saves its own register state and restores it | 301 | * we resume as it saves its own register state and restores it |
301 | * during the resume. */ | 302 | * during the resume. */ |
302 | 303 | ||
303 | cpu_suspend(0, pm_cpu_sleep); | 304 | ret = cpu_suspend(0, pm_cpu_sleep); |
305 | if (ret) | ||
306 | return ret; | ||
304 | 307 | ||
305 | /* restore the system state */ | 308 | /* restore the system state */ |
306 | 309 | ||