Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73692d9b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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()
parents 31dced41 1d927c3b
Loading
Loading
Loading
Loading
+6 −10
Original line number Original line Diff line number Diff line
@@ -300,17 +300,13 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
			/*
			/*
			 * Wait for the suspend/resume to complete.  If there
			 * Wait for the suspend/resume to complete.  If there
			 * are pending acknowledges, we wait here for them.
			 * 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();
			while (wait_event_freezable(apm_suspend_waitqueue,

					as->suspend_state == SUSPEND_DONE))
			wait_event(apm_suspend_waitqueue,
				msleep(10);
				   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();
			break;
			break;
		case SUSPEND_ACKTO:
		case SUSPEND_ACKTO:
			as->suspend_result = -ETIMEDOUT;
			as->suspend_result = -ETIMEDOUT;