Skip to content

Commit

Permalink
[ARM] Fix "apm -s" command hang
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Nov 30, 2006
1 parent b729c09 commit df58d03
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/arm/kernel/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand All @@ -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();
Expand Down

0 comments on commit df58d03

Please sign in to comment.