Skip to contentSkip to conversation

PM / Sleep: Print active wakeup sources when reading wakeup events blocked

PATCH Rafael J. Wysocki 1 participant 1 message Dec 6, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20161205033446.GA28666@lab

#1 lore raw
Quoted 6 lines · xing wei

If there are any wakeup events being processed, read operation on /sys/power/wakeup_count will be blocked, we can print the name of all active wakeup sources to help us find out who will block system enter sleep.

This doesn't seem to make it to linux-pm, I'm not sure why exactly.

Can you try to send it again, please?

Quoted 35 lines
---
  drivers/base/power/wakeup.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/power/wakeup.c +3 -3
index 62e4de2..bf9ba26 100644
@@ -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 ||
@@ -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();
  }
@@ -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);