Skip to content

Commit

Permalink
PM / sleep: Print active wakeup sources when blocking on wakeup_count…
Browse files Browse the repository at this point in the history
… reads

If there are any wakeup events being processed, read operation
on /sys/power/wakeup_count will be blocked, so print the names
of all active wakeup sources to help to find out who is preventing
system suspend from triggering.

While at it change pr_info() in pm_print_active_wakeup_sources()
to pr_debug() to avoid excessive log noise.

Signed-off-by: xing wei <xing.wei@intel.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
xing wei authored and Rafael J. Wysocki committed Dec 8, 2016
1 parent b53f40d commit 9320f95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ void pm_print_active_wakeup_sources(void)
rcu_read_lock();
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (ws->active) {
pr_info("active wakeup source: %s\n", ws->name);
pr_debug("active wakeup source: %s\n", ws->name);
active = 1;
} else if (!active &&
(!last_activity_ws ||
Expand All @@ -822,7 +822,7 @@ void pm_print_active_wakeup_sources(void)
}

if (!active && last_activity_ws)
pr_info("last active wakeup source: %s\n",
pr_debug("last active wakeup source: %s\n",
last_activity_ws->name);
rcu_read_unlock();
}
Expand Down Expand Up @@ -905,7 +905,7 @@ bool pm_get_wakeup_count(unsigned int *count, bool block)
split_counters(&cnt, &inpr);
if (inpr == 0 || signal_pending(current))
break;

pm_print_active_wakeup_sources();
schedule();
}
finish_wait(&wakeup_count_wait_queue, &wait);
Expand Down

0 comments on commit 9320f95

Please sign in to comment.