ARM: OMAP4+: PM: Program CPU logic power state
authorNishanth Menon <nm@ti.com>
Tue, 21 Oct 2014 20:24:36 +0000 (15:24 -0500)
committerTony Lindgren <tony@atomide.com>
Tue, 11 Nov 2014 00:02:05 +0000 (16:02 -0800)
commita30d81b98a778c4ce113ba9c2e03deb2f9522d66
tree78982b794c2cf738ced4d104b26595ff30b3a7dd
parentb9f5fe6425ef1622fb0f16f0fa33f19b993863a6
ARM: OMAP4+: PM: Program CPU logic power state

CPU logic power state is never programmed in either the initialization
or the suspend/resume logic, instead, we depend on mpuss to program this
properly. However, this leaves CPU logic power state indeterminate and
most probably in reset configuration (If bootloader or other similar
software have'nt monkeyed with the register). This can make powerstate=
RET be either programmed for CSWR (logic=ret) or OSWR(logic = OFF) and
in OSWR, there can be context loss when the code does not expect it.

To prevent all these confusions, just support clearly ON, INA, CSWR,
OFF which is the intent of the existing code by explicitly programming
logic state.

NOTE: since this is a hot path (using in cpuidle), the exit path just
programs powerstate (logic state is immaterial when powerstate is ON).

Without doing this, we end up with lockups when CPUs enter OSWR and
multiple blocks loose context, when we expect them to hit CSWR.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/omap-mpuss-lowpower.c