From: Laxman Dewangan <ldewangan@nvidia.com>
To: <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH] irq: enable suspended EARLY_RESUME irqs forcefully if not resumed
Date: Tue, 9 Jul 2013 20:02:23 +0530 [thread overview]
Message-ID: <1373380343-10143-1-git-send-email-ldewangan@nvidia.com> (raw)
When system enters into suspend, it disable all irqs in single
function call. This disables EARLY_RESUME irqs also along with
normal irqs.
The EARLY_RESUME irqs get enabled in sys_core_ops->resume and
non-EARLY_RESUME irqs get enabled in normal system resume path.
When suspend_noirq failed or suspend is aborted for any reason,
the EARLY_RESUME irqs do not get enabled as sys_core_ops->resume()
call did not happen. It only enables the non-EARLY_RESUME irqs in normal
disable for remaining life of system.
Add checks on normal irq_resume() whether EARLY_RESUME irqs have been
enabled or not and if not then enable it forcefully.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
kernel/irq/pm.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
index cb228bf..e8a1427 100644
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
@@ -13,6 +13,8 @@
#include "internals.h"
+static bool early_resume_irq_suspended;
+
/**
* suspend_device_irqs - disable all currently enabled interrupt lines
*
@@ -37,6 +39,7 @@ void suspend_device_irqs(void)
for_each_irq_desc(irq, desc)
if (desc->istate & IRQS_SUSPENDED)
synchronize_irq(irq);
+ early_resume_irq_suspended = true;
}
EXPORT_SYMBOL_GPL(suspend_device_irqs);
@@ -67,6 +70,7 @@ static void resume_irqs(bool want_early)
static void irq_pm_syscore_resume(void)
{
resume_irqs(true);
+ early_resume_irq_suspended = false;
}
static struct syscore_ops irq_pm_syscore_ops = {
@@ -87,9 +91,15 @@ device_initcall(irq_pm_init_ops);
* Enable all non-%IRQF_EARLY_RESUME interrupt lines previously
* disabled by suspend_device_irqs() that have the IRQS_SUSPENDED flag
* set as well as those with %IRQF_FORCE_RESUME.
+ * Also enable IRQF_EARLY_RESUME irqs if it is not enabled by syscore_ops
+ * resume path.
*/
void resume_device_irqs(void)
{
+ if (early_resume_irq_suspended) {
+ pr_err("%s: Resuming IRQF_EARLY_RESUME forcefully\n", __func__);
+ irq_pm_syscore_resume();
+ }
resume_irqs(false);
}
EXPORT_SYMBOL_GPL(resume_device_irqs);
--
1.7.1.1
next reply other threads:[~2013-07-09 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 14:32 Laxman Dewangan [this message]
2013-07-19 14:00 ` Laxman Dewangan
2013-07-19 15:29 ` Thomas Gleixner
2013-07-22 15:49 ` Konrad Rzeszutek Wilk
2013-07-22 19:32 ` Konrad Rzeszutek Wilk
2013-07-31 14:10 ` Laxman Dewangan
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=1373380343-10143-1-git-send-email-ldewangan@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®