Skip to content

Commit 73692d9

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/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()
2 parents 31dced4 + 1d927c3 commit 73692d9

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎drivers/char/apm-emulation.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,13 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
300300
/*
301301
* Wait for the suspend/resume to complete. If there
302302
* are pending acknowledges, we wait here for them.
303+
* wait_event_freezable() is interruptible and pending
304+
* signal can cause busy looping. We aren't doing
305+
* anything critical, chill a bit on each iteration.
303306
*/
304-
freezer_do_not_count();
305-
306-
wait_event(apm_suspend_waitqueue,
307-
as->suspend_state == SUSPEND_DONE);
308-
309-
/*
310-
* Since we are waiting until the suspend is done, the
311-
* try_to_freeze() in freezer_count() will not trigger
312-
*/
313-
freezer_count();
307+
while (wait_event_freezable(apm_suspend_waitqueue,
308+
as->suspend_state == SUSPEND_DONE))
309+
msleep(10);
314310
break;
315311
case SUSPEND_ACKTO:
316312
as->suspend_result = -ETIMEDOUT;

0 commit comments

Comments
 (0)