aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorAlexandra Yates <alexandra.yates@linux.intel.com>2015-09-15 13:32:46 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-16 08:20:41 -0400
commita6f5f0dd4e21191ce35030dd4d6421e1cca10ee4 (patch)
treed11055309f1b697fe91aadaf327dace3412b31f1 /drivers/base
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
PM / sleep: Report interrupt that caused system wakeup
Add a sysfs attribute, /sys/power/pm_wakeup_irq, reporting the IRQ number of the first wakeup interrupt (that is, the first interrupt from an IRQ line armed for system wakeup) seen by the kernel during the most recent system suspend/resume cycle. This feature will be useful for system wakeup diagnostics of spurious wakeup interrupts. Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com> [ rjw: Fixed up pm_wakeup_irq definition ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/wakeup.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 51f15bc15774..3b361ecfaffc 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -25,6 +25,9 @@
25 */ 25 */
26bool events_check_enabled __read_mostly; 26bool events_check_enabled __read_mostly;
27 27
28/* First wakeup IRQ seen by the kernel in the last cycle. */
29unsigned int pm_wakeup_irq __read_mostly;
30
28/* If set and the system is suspending, terminate the suspend. */ 31/* If set and the system is suspending, terminate the suspend. */
29static bool pm_abort_suspend __read_mostly; 32static bool pm_abort_suspend __read_mostly;
30 33
@@ -868,6 +871,15 @@ EXPORT_SYMBOL_GPL(pm_system_wakeup);
868void pm_wakeup_clear(void) 871void pm_wakeup_clear(void)
869{ 872{
870 pm_abort_suspend = false; 873 pm_abort_suspend = false;
874 pm_wakeup_irq = 0;
875}
876
877void pm_system_irq_wakeup(unsigned int irq_number)
878{
879 if (pm_wakeup_irq == 0) {
880 pm_wakeup_irq = irq_number;
881 pm_system_wakeup();
882 }
871} 883}
872 884
873/** 885/**