From aa8aba6944203a17a7e941b42d8415153c649660 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 12 Dec 2008 00:24:34 +0000 Subject: [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 --- arch/arm/plat-s3c/pm-check.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'arch/arm/plat-s3c/pm-check.c') diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-s3c/pm-check.c index 183f1304bf5..39f2555564d 100644 --- a/arch/arm/plat-s3c/pm-check.c +++ b/arch/arm/plat-s3c/pm-check.c @@ -222,9 +222,21 @@ static u32 *s3c_pm_runcheck(struct resource *res, u32 *val) */ void s3c_pm_check_restore(void) { - if (crcs != NULL) { + if (crcs != NULL) s3c_pm_run_sysram(s3c_pm_runcheck, crcs); - kfree(crcs); - crcs = NULL; - } } + +/** + * s3c_pm_check_cleanup() - free memory resources + * + * Free the resources that where allocated by the suspend + * memory check code. We do this separately from the + * s3c_pm_check_restore() function as we cannot call any + * functions that might sleep during that resume. + */ +void s3c_pm_check_cleanup(void) +{ + kfree(crcs); + crcs = NULL; +} + -- cgit v1.2.3