summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c/pm.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-12-12 00:24:34 +0000
committerBen Dooks <ben-linux@fluff.org>2009-03-08 13:19:54 +0000
commitaa8aba6944203a17a7e941b42d8415153c649660 (patch)
tree83b96dda96383f02c2c7be746e3e71e183e9271d /arch/arm/plat-s3c/pm.c
parent663a83048c602d5176c23489b4e29598d753e42b (diff)
[ARM] S3C: Do not kmalloc/kfree during inner suspend code.
The PM CRC checking code kmallocs an area to save a set of CRC values during suspend. This triggers a warning due to the call of a function that might sleep whilst the system is not in a valid state to do so. Move the allocation and free to points in the suspend and resume process where they can call a function that might-sleep. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/pm.c')
-rw-r--r--arch/arm/plat-s3c/pm.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index 78bf50a1402..a0ca18a75b0 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -254,10 +254,6 @@ static int s3c_pm_enter(suspend_state_t state)
return -EINVAL;
}
- /* prepare check area if configured */
-
- s3c_pm_check_prepare();
-
/* store the physical address of the register recovery block */
s3c_sleep_save_phys = virt_to_phys(regs_save);
@@ -329,8 +325,23 @@ static int s3c_pm_enter(suspend_state_t state)
return 0;
}
+static int s3c_pm_prepare(void)
+{
+ /* prepare check area if configured */
+
+ s3c_pm_check_prepare();
+ return 0;
+}
+
+static void s3c_pm_finish(void)
+{
+ s3c_pm_check_cleanup();
+}
+
static struct platform_suspend_ops s3c_pm_ops = {
.enter = s3c_pm_enter,
+ .prepare = s3c_pm_prepare,
+ .finish = s3c_pm_finish,
.valid = suspend_valid_only_mem,
};