diff options
author | xing wei <xing.wei@intel.com> | 2016-12-07 06:31:16 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-07 19:26:23 -0500 |
commit | 9320f95c0b8f1d074f570385e6855d4554f693e4 (patch) | |
tree | e789238fc895e172a4c19cce4ed20c664e827e7e | |
parent | b53f40db59b27b62bc294c30506b02a0cae47e0b (diff) |
PM / sleep: Print active wakeup sources when blocking on wakeup_count 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>
-rw-r--r-- | drivers/base/power/wakeup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 62e4de2aa8d1..bf9ba26981a5 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c | |||
@@ -811,7 +811,7 @@ void pm_print_active_wakeup_sources(void) | |||
811 | rcu_read_lock(); | 811 | rcu_read_lock(); |
812 | list_for_each_entry_rcu(ws, &wakeup_sources, entry) { | 812 | list_for_each_entry_rcu(ws, &wakeup_sources, entry) { |
813 | if (ws->active) { | 813 | if (ws->active) { |
814 | pr_info("active wakeup source: %s\n", ws->name); | 814 | pr_debug("active wakeup source: %s\n", ws->name); |
815 | active = 1; | 815 | active = 1; |
816 | } else if (!active && | 816 | } else if (!active && |
817 | (!last_activity_ws || | 817 | (!last_activity_ws || |
@@ -822,7 +822,7 @@ void pm_print_active_wakeup_sources(void) | |||
822 | } | 822 | } |
823 | 823 | ||
824 | if (!active && last_activity_ws) | 824 | if (!active && last_activity_ws) |
825 | pr_info("last active wakeup source: %s\n", | 825 | pr_debug("last active wakeup source: %s\n", |
826 | last_activity_ws->name); | 826 | last_activity_ws->name); |
827 | rcu_read_unlock(); | 827 | rcu_read_unlock(); |
828 | } | 828 | } |
@@ -905,7 +905,7 @@ bool pm_get_wakeup_count(unsigned int *count, bool block) | |||
905 | split_counters(&cnt, &inpr); | 905 | split_counters(&cnt, &inpr); |
906 | if (inpr == 0 || signal_pending(current)) | 906 | if (inpr == 0 || signal_pending(current)) |
907 | break; | 907 | break; |
908 | 908 | pm_print_active_wakeup_sources(); | |
909 | schedule(); | 909 | schedule(); |
910 | } | 910 | } |
911 | finish_wait(&wakeup_count_wait_queue, &wait); | 911 | finish_wait(&wakeup_count_wait_queue, &wait); |