]> Git Repo - linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm
authorLinus Torvalds <[email protected]>
Tue, 25 Oct 2011 10:03:58 +0000 (12:03 +0200)
committerLinus Torvalds <[email protected]>
Tue, 25 Oct 2011 10:03:58 +0000 (12:03 +0200)
* '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()

1  2 
drivers/char/apm-emulation.c

index a7346ab97a3c22002ffc6948321ca24b1720b8f9,7e2709c35fcf2f0a9d6b5dd55b24ce90b43722c5..2a2b8fd708c11a6d1772fd2e5b4b11502c6fdf1c
@@@ -300,17 -300,13 +300,13 @@@ apm_ioctl(struct file *filp, u_int cmd
                        /*
                         * 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;
@@@ -606,7 -602,7 +602,7 @@@ static int apm_suspend_notifier(struct 
                        return NOTIFY_OK;
  
                /* interrupted by signal */
 -              return NOTIFY_BAD;
 +              return notifier_from_errno(err);
  
        case PM_POST_SUSPEND:
                /*
This page took 0.082078 seconds and 4 git commands to generate.