summaryrefslogtreecommitdiffstats
path: root/kernel/power
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 /kernel/power
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 'kernel/power')
-rw-r--r--kernel/power/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 63d395b5df93..b2dd4d999900 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -272,6 +272,22 @@ static inline void pm_print_times_init(void)
272{ 272{
273 pm_print_times_enabled = !!initcall_debug; 273 pm_print_times_enabled = !!initcall_debug;
274} 274}
275
276static ssize_t pm_wakeup_irq_show(struct kobject *kobj,
277 struct kobj_attribute *attr,
278 char *buf)
279{
280 return pm_wakeup_irq ? sprintf(buf, "%u\n", pm_wakeup_irq) : -ENODATA;
281}
282
283static ssize_t pm_wakeup_irq_store(struct kobject *kobj,
284 struct kobj_attribute *attr,
285 const char *buf, size_t n)
286{
287 return -EINVAL;
288}
289power_attr(pm_wakeup_irq);
290
275#else /* !CONFIG_PM_SLEEP_DEBUG */ 291#else /* !CONFIG_PM_SLEEP_DEBUG */
276static inline void pm_print_times_init(void) {} 292static inline void pm_print_times_init(void) {}
277#endif /* CONFIG_PM_SLEEP_DEBUG */ 293#endif /* CONFIG_PM_SLEEP_DEBUG */
@@ -604,6 +620,7 @@ static struct attribute * g[] = {
604#endif 620#endif
605#ifdef CONFIG_PM_SLEEP_DEBUG 621#ifdef CONFIG_PM_SLEEP_DEBUG
606 &pm_print_times_attr.attr, 622 &pm_print_times_attr.attr,
623 &pm_wakeup_irq_attr.attr,
607#endif 624#endif
608#endif 625#endif
609#ifdef CONFIG_FREEZER 626#ifdef CONFIG_FREEZER