diff options
author | Xinyu Chen <xinyu.chen@freescale.com> | 2012-03-16 09:42:34 +0800 |
---|---|---|
committer | Xinyu Chen <xinyu.chen@freescale.com> | 2012-03-16 09:54:46 +0800 |
commit | 4b5cdefdbcb3eb0c01efc714e2b7fe6d8fb5ca21 (patch) | |
tree | 63fa92f684fa43a7975fa70c5855c43b0d316ac0 /drivers | |
parent | 779beac355abcaffdefc958feec5b0a2992d850d (diff) |
ENGR00175844 irq: enable IRQF_EARLY_RESUME irq when dpm_suspend_noirq failed
The dpm_suspend_noirq routing calls suspend_device_irqs()
first to disable all the irq no matter what flags it has.
Then it enumerates the device driver on dpm_suspend_list to
call their suspend_noirq pm callback. If any dev suspend
failed, it will call dpm_resume_noirq to re-enable all
the irq without IRQF_EARLY_RESUME, and return failed.
If dpm_suspend_noirq() return failed, then no syscore_resume()
can be called, that means the irq with flag IRQF_EARLY_RESUME,
can not be re-enabled on this case.
error = dpm_suspend_noirq(PMSG_SUSPEND);
if (error) {
..
goto Platform_finish;
}
....
error = syscore_suspend();
if (!error) {
...
syscore_resume();
}
...
dpm_resume_noirq(PMSG_RESUME);
Platform_finish:
if (suspend_ops->finish)
suspend_ops->finish();
So we must enable all the irqs no matter it's IRQF_EARLY_RESUME
or not.
Otherwise the GPIO power key who's irq has flag of IRQF_EARLY_RESUME
will be disabled forever when some device failed to suspend.
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/power/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 93a5a81ebfa3..b4e94fce22d1 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -870,8 +870,10 @@ int dpm_suspend_noirq(pm_message_t state) put_device(dev); } mutex_unlock(&dpm_list_mtx); - if (error) + if (error) { + resume_irqs(true); dpm_resume_noirq(resume_event(state)); + } else dpm_show_time(starttime, state, "late"); return error; |