aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/wakeup.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index cbb463b3a750..8a0a9ca6ad65 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -649,6 +649,31 @@ void pm_wakeup_event(struct device *dev, unsigned int msec)
649} 649}
650EXPORT_SYMBOL_GPL(pm_wakeup_event); 650EXPORT_SYMBOL_GPL(pm_wakeup_event);
651 651
652static void print_active_wakeup_sources(void)
653{
654 struct wakeup_source *ws;
655 int active = 0;
656 struct wakeup_source *last_activity_ws = NULL;
657
658 rcu_read_lock();
659 list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
660 if (ws->active) {
661 pr_info("active wakeup source: %s\n", ws->name);
662 active = 1;
663 } else if (!active &&
664 (!last_activity_ws ||
665 ktime_to_ns(ws->last_time) >
666 ktime_to_ns(last_activity_ws->last_time))) {
667 last_activity_ws = ws;
668 }
669 }
670
671 if (!active && last_activity_ws)
672 pr_info("last active wakeup source: %s\n",
673 last_activity_ws->name);
674 rcu_read_unlock();
675}
676
652/** 677/**
653 * pm_wakeup_pending - Check if power transition in progress should be aborted. 678 * pm_wakeup_pending - Check if power transition in progress should be aborted.
654 * 679 *
@@ -671,6 +696,10 @@ bool pm_wakeup_pending(void)
671 events_check_enabled = !ret; 696 events_check_enabled = !ret;
672 } 697 }
673 spin_unlock_irqrestore(&events_lock, flags); 698 spin_unlock_irqrestore(&events_lock, flags);
699
700 if (ret)
701 print_active_wakeup_sources();
702
674 return ret; 703 return ret;
675} 704}
676 705