Message ID | 1406910649-4028-2-git-send-email-amit.pundir@linaro.org |
---|---|
State | New |
Headers | show |
On Fri, Aug 1, 2014 at 9:30 AM, Amit Pundir <amit.pundir@linaro.org> wrote: > From: Todd Poynor <toddpoynor@google.com> > > Currently when a pending wakeup irq stops suspend, it can be difficult > to determine why suspend was prevented and which IRQ was actually > responsible. > > In order to help debug these situations, this patch prints the IRQ > number and action name of that pending wakeup irq which prevents suspend. > This patch comes from the Android patch set, where its been used to debug > suspend problems. This info is sometimes useful to debugging Android suspend / battery life problems, such as to detect a driver that is failing to service or clear a wakeup interrupt condition. In general, we intend to fold reporting of suspend abort reasons (wakeup IRQ pending, wakelock grabbed, task refusing to freeze...) into the wakeup reason reporting API to userspace previously discussed on the linux-pm list (and also revive discussion of how to rework that for mainline acceptance soon). Thanks, Todd -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri 2014-08-01 22:00:48, Amit Pundir wrote: > From: Todd Poynor <toddpoynor@google.com> > > Currently when a pending wakeup irq stops suspend, it can be difficult > to determine why suspend was prevented and which IRQ was actually > responsible. > > In order to help debug these situations, this patch prints the IRQ > number and action name of that pending wakeup irq which prevents suspend. > This patch comes from the Android patch set, where its been used to debug > suspend problems. > Acked-by: Pavel Machek <pavel@ucw.cz>
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index abcd6ca..c2bc8d9 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c @@ -109,8 +109,13 @@ int check_wakeup_irqs(void) * can abort suspend. */ if (irqd_is_wakeup_set(&desc->irq_data)) { - if (desc->depth == 1 && desc->istate & IRQS_PENDING) + if (desc->depth == 1 && desc->istate & IRQS_PENDING) { + pr_info("Wakeup IRQ %d %s pending, suspend aborted\n", + irq, + desc->action && desc->action->name ? + desc->action->name : ""); return -EBUSY; + } continue; } /*