diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-11-07 22:01:30 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-11-30 13:24:45 +0100 |
commit | df58d0359581bbd4ee741406d81e69456c684f9d (patch) | |
tree | 3452ee043e7a15c1855703d6e9b2a0e6b49f6113 /arch | |
parent | [ARM] Improve reliability of APM-emulation suspend (diff) | |
download | linux-df58d0359581bbd4ee741406d81e69456c684f9d.tar.xz linux-df58d0359581bbd4ee741406d81e69456c684f9d.zip |
[ARM] Fix "apm -s" command hang
Fix an apparant hang with the "apm -s" command. We omitted to wake up
this process once resume had completed.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-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) wait_event(apm_suspend_waitqueue, as->suspend_state == SUSPEND_DONE); } else { + as->suspend_state = SUSPEND_WAIT; up(&state_lock); /* @@ -349,8 +350,14 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) * acknowledged. */ err = queue_suspend_event(APM_USER_SUSPEND, as); - if (err < 0) + if (err < 0) { + /* + * Avoid taking the lock here - this + * should be fine. + */ + as->suspend_state = SUSPEND_NONE; break; + } if (err > 0) apm_suspend(); |