Skip to content

Commit

Permalink
PM / Wakeup: Don't update events_check_enabled in pm_get_wakeup_count()
Browse files Browse the repository at this point in the history
Since pm_save_wakeup_count() has just been changed to clear
events_check_enabled unconditionally before checking if there are
any new wakeup events registered since the last read from
/sys/power/wakeup_count, the detection of wakeup events during
suspend may be disabled, after it's been enabled, by writing a
"wrong" value back to /sys/power/wakeup_count.  For this reason,
it is not necessary to update events_check_enabled in
pm_get_wakeup_count() any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Rafael J. Wysocki committed Mar 14, 2011
1 parent 378eef9 commit 790c788
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,14 @@ bool pm_wakeup_pending(void)
* Store the number of registered wakeup events at the address in @count. Block
* if the current number of wakeup events being processed is nonzero.
*
* Return false if the wait for the number of wakeup events being processed to
* Return 'false' if the wait for the number of wakeup events being processed to
* drop down to zero has been interrupted by a signal (and the current number
* of wakeup events being processed is still nonzero). Otherwise return true.
* of wakeup events being processed is still nonzero). Otherwise return 'true'.
*/
bool pm_get_wakeup_count(unsigned int *count)
{
unsigned int cnt, inpr;

if (capable(CAP_SYS_ADMIN))
events_check_enabled = false;

for (;;) {
split_counters(&cnt, &inpr);
if (inpr == 0 || signal_pending(current))
Expand Down

0 comments on commit 790c788

Please sign in to comment.