linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xing Wei <xing.wei@intel.com>
To: rafael.j.wysocki@intel.com
Cc: austin.zhang@intel.com, toddpoynor@google.com,
	linux-pm@vger.kernel.org, xing wei <xing.wei@intel.com>
Subject: [PATCH] PM / Sleep: Print active wakeup sources when reading wakeup events blocked
Date: Wed,  7 Dec 2016 19:31:16 +0800	[thread overview]
Message-ID: <1481110276-5325-1-git-send-email-xing.wei@intel.com> (raw)

From: xing wei <xing.wei@intel.com>

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.

Signed-off-by: xing wei <xing.wei@intel.com>
---
 drivers/base/power/wakeup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 62e4de2..bf9ba26 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -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);
-- 
1.9.1


             reply	other threads:[~2016-12-07 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 11:31 Xing Wei [this message]
     [not found] <20161205033446.GA28666@lab>
2016-12-06 21:07 ` [PATCH] PM / Sleep: Print active wakeup sources when reading wakeup events blocked Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481110276-5325-1-git-send-email-xing.wei@intel.com \
    --to=xing.wei@intel.com \
    --cc=austin.zhang@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=toddpoynor@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).