Commit b80dbb87 authored by Tony Lindgren's avatar Tony Lindgren Committed by Khalid Elmously

ARM: OMAP3: Fix prm wake interrupt for resume

BugLink: https://bugs.launchpad.net/bugs/1775771

[ Upstream commit d3be6d2a ]

For platform_suspend_ops, the finish call is too late to re-enable wake
irqs and we need re-enable wake irqs on wake call instead.

Otherwise noirq resume for devices has already happened. And then
dev_pm_disarm_wake_irq() has already disabled the dedicated wake irqs
when the interrupt triggers and the wake irq is never handled.

For devices that are already in PM runtime suspended state when we
enter suspend this means that a possible wake irq will never trigger.

And this can lead into a situation where a device has a pending padconf
wake irq, and the device will stay unresponsive to any further wake
irqs.

This issue can be easily reproduced by setting serial console log level
to zero, letting the serial console idle, and suspend the system from
an ssh terminal. Then try to wake up the system by typing to the serial
console.

Note that this affects only omap3 PRM interrupt as that's currently
the only omap variant that does anything in omap_pm_wake().

In general, for the wake irqs to work, the interrupt must have either
IRQF_NO_SUSPEND or IRQF_EARLY_RESUME set for it to trigger before
dev_pm_disarm_wake_irq() disables the wake irqs.
Reported-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 507496ec
...@@ -231,7 +231,7 @@ static void omap_pm_end(void) ...@@ -231,7 +231,7 @@ static void omap_pm_end(void)
cpu_idle_poll_ctrl(false); cpu_idle_poll_ctrl(false);
} }
static void omap_pm_finish(void) static void omap_pm_wake(void)
{ {
if (cpu_is_omap34xx()) if (cpu_is_omap34xx())
omap_prcm_irq_complete(); omap_prcm_irq_complete();
...@@ -241,7 +241,7 @@ static const struct platform_suspend_ops omap_pm_ops = { ...@@ -241,7 +241,7 @@ static const struct platform_suspend_ops omap_pm_ops = {
.begin = omap_pm_begin, .begin = omap_pm_begin,
.end = omap_pm_end, .end = omap_pm_end,
.enter = omap_pm_enter, .enter = omap_pm_enter,
.finish = omap_pm_finish, .wake = omap_pm_wake,
.valid = suspend_valid_only_mem, .valid = suspend_valid_only_mem,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment