From: Russell King Date: Tue, 7 Nov 2006 21:01:30 +0000 (+0000) Subject: [ARM] Fix "apm -s" command hang X-Git-Tag: v2.6.20-rc1~34^2~412^2~1^2^3~37 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=df58d0359581bbd4ee741406d81e69456c684f9d;p=linux-2.6-omap-h63xx.git [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 --- diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index bbe98e3b860..845af0bc110 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();