OMAP2+: PM: SmartReflex: use put_sync_suspend for IRQ-safe disabling
authorColin Cross <ccross@google.com>
Fri, 22 Jul 2011 05:55:52 +0000 (00:55 -0500)
committerKevin Hilman <khilman@ti.com>
Fri, 5 Aug 2011 18:54:59 +0000 (11:54 -0700)
commit98333b3dda1e490b02304a6a6643c294d4e520c3
treeef9a495f4c54c3dbd52b07393c0bb847c19d2cac
parent8c7f65943dfb93c2583f935f20ec39e8559d93d3
OMAP2+: PM: SmartReflex: use put_sync_suspend for IRQ-safe disabling

omap_sr_disable_reset_volt is called with irqs off in omapx_enter_sleep,
as part of idle sequence, this eventually calls sr_disable and
pm_runtime_put_sync. pm_runtime_put_sync calls rpm_idle, which will
enable interrupts in order to call the callback. In this short interval
when interrupts are enabled, scenarios such as the following can occur:
while interrupts are enabled, the timer interrupt that is supposed to
wake the device out of idle occurs and is acked, so when the CPU finally
goes to off, the timer is already gone, missing a wakeup event.

Further, as the documentation for runtime states:"
 However, subsystems can use the pm_runtime_irq_safe() helper function
 to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
 callbacks should be invoked in atomic context with interrupts disabled
 (->runtime_idle() is still invoked the default way)."

Hence, replace pm_runtime_put_sync with pm_runtime_put_sync_suspend
to invoke the suspend handler and shut off the fclk for SmartReflex
module instead of using the idle handler in interrupt disabled context.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Colin Cross <ccross@google.com>
[khilman@ti.com: minor Subject edits]
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/smartreflex.c