From: Linus Torvalds Date: Tue, 25 Oct 2011 10:03:58 +0000 (+0200) Subject: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm X-Git-Tag: v3.2-rc1~186 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=73692d9bb58ecc2fa73f4b2bfcf6eadaa6d49a26;hp=31dced41c6822ce751c033a53502ea4d8d399422 Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/apm * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm: apm-emulation: use wait_event_freezable() instead of freezer_[do_not_]count() --- diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index a7346ab97a3c..2a2b8fd708c1 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c @@ -300,17 +300,13 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg) /* * Wait for the suspend/resume to complete. If there * are pending acknowledges, we wait here for them. + * wait_event_freezable() is interruptible and pending + * signal can cause busy looping. We aren't doing + * anything critical, chill a bit on each iteration. */ - freezer_do_not_count(); - - wait_event(apm_suspend_waitqueue, - as->suspend_state == SUSPEND_DONE); - - /* - * Since we are waiting until the suspend is done, the - * try_to_freeze() in freezer_count() will not trigger - */ - freezer_count(); + while (wait_event_freezable(apm_suspend_waitqueue, + as->suspend_state == SUSPEND_DONE)) + msleep(10); break; case SUSPEND_ACKTO: as->suspend_result = -ETIMEDOUT;