From d3fcacf52d24ff1b12d994d9ddb7496f651294a2 Mon Sep 17 00:00:00 2001 From: Abhilash Kesavan Date: Fri, 25 Jan 2013 10:40:19 -0800 Subject: 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 Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/pm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/arm/plat-samsung') 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); static int s3c_pm_enter(suspend_state_t state) { + int ret; /* ensure the debug is initialised (if enabled) */ s3c_pm_debug_init(); @@ -300,7 +301,9 @@ static int s3c_pm_enter(suspend_state_t state) * we resume as it saves its own register state and restores it * during the resume. */ - cpu_suspend(0, pm_cpu_sleep); + ret = cpu_suspend(0, pm_cpu_sleep); + if (ret) + return ret; /* restore the system state */ -- cgit v1.2.3-59-g8ed1b