diff options
-rw-r--r-- | arch/arm/kernel/apm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index bbe98e3b860b..845af0bc1108 100644 --- a/arch/arm/kernel/apm.c +++ b/arch/arm/kernel/apm.c | |||
@@ -340,6 +340,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) | |||
340 | wait_event(apm_suspend_waitqueue, | 340 | wait_event(apm_suspend_waitqueue, |
341 | as->suspend_state == SUSPEND_DONE); | 341 | as->suspend_state == SUSPEND_DONE); |
342 | } else { | 342 | } else { |
343 | as->suspend_state = SUSPEND_WAIT; | ||
343 | up(&state_lock); | 344 | up(&state_lock); |
344 | 345 | ||
345 | /* | 346 | /* |
@@ -349,8 +350,14 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) | |||
349 | * acknowledged. | 350 | * acknowledged. |
350 | */ | 351 | */ |
351 | err = queue_suspend_event(APM_USER_SUSPEND, as); | 352 | err = queue_suspend_event(APM_USER_SUSPEND, as); |
352 | if (err < 0) | 353 | if (err < 0) { |
354 | /* | ||
355 | * Avoid taking the lock here - this | ||
356 | * should be fine. | ||
357 | */ | ||
358 | as->suspend_state = SUSPEND_NONE; | ||
353 | break; | 359 | break; |
360 | } | ||
354 | 361 | ||
355 | if (err > 0) | 362 | if (err > 0) |
356 | apm_suspend(); | 363 | apm_suspend(); |