diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-06-03 17:51:30 +0530 |
---|---|---|
committer | Harshada Kale <hkale@nvidia.com> | 2013-06-05 07:12:44 -0700 |
commit | 91262b293e7c061f6c80488fa235811362e128e6 (patch) | |
tree | 4e9ef4c1114deceb5686672d2bf165dab7d1afdc /kernel | |
parent | 15ed647521e618c365739e8bfc756c3307c7d659 (diff) |
irq: enable suspended EARLY_RESUME irqs forcefully if not resumed
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
system resume path. This makes the EARLY_RESUME irqs interrupt to be
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.
bug 1282448
Change-Id: I7ffffd725675ca635310eb4913a1f885d2e42e37
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/235000
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Mark Kuo <mkuo@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | 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 fe4b09cf829c..92d49eddd7da 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); |