diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-12-11 19:24:34 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-03-08 09:19:54 -0400 |
commit | aa8aba6944203a17a7e941b42d8415153c649660 (patch) | |
tree | 83b96dda96383f02c2c7be746e3e71e183e9271d /arch/arm/plat-s3c/pm-check.c | |
parent | 663a83048c602d5176c23489b4e29598d753e42b (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-check.c')
-rw-r--r-- | arch/arm/plat-s3c/pm-check.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-s3c/pm-check.c index 183f1304bf58..39f2555564da 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) | |||
222 | */ | 222 | */ |
223 | void s3c_pm_check_restore(void) | 223 | void s3c_pm_check_restore(void) |
224 | { | 224 | { |
225 | if (crcs != NULL) { | 225 | if (crcs != NULL) |
226 | s3c_pm_run_sysram(s3c_pm_runcheck, crcs); | 226 | s3c_pm_run_sysram(s3c_pm_runcheck, crcs); |
227 | kfree(crcs); | ||
228 | crcs = NULL; | ||
229 | } | ||
230 | } | 227 | } |
228 | |||
229 | /** | ||
230 | * s3c_pm_check_cleanup() - free memory resources | ||
231 | * | ||
232 | * Free the resources that where allocated by the suspend | ||
233 | * memory check code. We do this separately from the | ||
234 | * s3c_pm_check_restore() function as we cannot call any | ||
235 | * functions that might sleep during that resume. | ||
236 | */ | ||
237 | void s3c_pm_check_cleanup(void) | ||
238 | { | ||
239 | kfree(crcs); | ||
240 | crcs = NULL; | ||
241 | } | ||
242 | |||