diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-20 17:37:21 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-20 17:37:21 -0700 |
| commit | 6d91e54df73f7ce9e47782fa371125d846aaafa2 (patch) | |
| tree | c38642f3f3f952c7413cd7a637157ad4bb991511 /arch | |
| parent | 3e5ef0c6d466d994b662cbd5fb7444fb949b460b (diff) | |
| parent | efb4cd1196d066f8c345f1935c53246db7641c8a (diff) | |
Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/kernel/apm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index 267f6971082e..70aade05b50d 100644 --- a/arch/arm/kernel/apm.c +++ b/arch/arm/kernel/apm.c @@ -202,7 +202,7 @@ static void apm_suspend(void) } up_read(&user_list_lock); - wake_up_interruptible(&apm_suspend_waitqueue); + wake_up(&apm_suspend_waitqueue); } static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos) @@ -306,7 +306,15 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) flags = current->flags; current->flags |= PF_NOFREEZE; - wait_event_interruptible(apm_suspend_waitqueue, + /* + * Note: do not allow a thread which is acking the suspend + * to escape until the resume is complete. + */ + if (as->suspend_state == SUSPEND_ACKED) + wait_event(apm_suspend_waitqueue, + as->suspend_state == SUSPEND_DONE); + else + wait_event_interruptible(apm_suspend_waitqueue, as->suspend_state == SUSPEND_DONE); current->flags = flags; |
