linux/arch/arm/plat-omap
NeilBrown 9cc268d5bb ARM: OMAP: Simplify dmtimer context-loss handling
The context loss handling in dmtimer appears to assume that
omap_dm_timer_set_load_start() or omap_dm_timer_start() and
omap_dm_timer_stop() bracket all interactions.  Only the first two
restore the context and the last updates the context loss counter.
However omap_dm_timer_set_load() or omap_dm_timer_set_match() can
reasonably be called outside this bracketing, and the fact that they
call omap_dm_timer_enable() / omap_dm_timer_disable() suggest that
is expected.

So if, after a transition into and out of off-mode which would cause
the dm timer to loose all state, omap_dm_timer_set_match() is called
before omap_dm_timer_start(), the value read from OMAP_TIMER_CTRL_REG
will be 'wrong' and this wrong value will be stored context.tclr so
a subsequent omap_dm_timer_start() can fail (As the control register
is wrong).

Simplify this be doing the restore-from-context in
omap_dm_timer_enable() so that whenever the timer is enabled, the
context is correct. Also update the ctx_loss_count at the same time as
we notice it is wrong - these is no value in delaying this until the
omap_dm_timer_disable() as it cannot change while the timer is enabled.

Signed-off-by: NeilBrown <neilb@suse.de>
[jon-hunter@ti.com: minor update to subject and changed variable name]
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
2013-04-09 00:21:29 +02:00
..
include/plat arm-soc: late OMAP changes 2013-02-28 20:00:40 -08:00
counter_32k.c ARM: OMAP: 32k counter: resolve sparse warnings 2012-12-28 02:09:01 -07:00
debug-leds.c ARM: OMAP: debug-leds: Use resource_size instead of hard coded macro 2012-11-12 13:28:28 -08:00
dma.c ARM: OMAP: Fix the use of uninitialized dma_lch_count 2013-02-01 14:39:54 -08:00
dmtimer.c ARM: OMAP: Simplify dmtimer context-loss handling 2013-04-09 00:21:29 +02:00
i2c.c ARM: OMAP: Fix i2c cmdline initcall for multiplatform 2013-01-11 11:24:19 -08:00
Kconfig arm-soc: late OMAP changes 2013-02-28 20:00:40 -08:00
mailbox.c workqueue: deprecate flush[_delayed]_work_sync() 2012-08-20 14:51:24 -07:00
Makefile ARM: OMAP2+: Enable ARCH_MULTIPLATFORM support 2013-01-11 11:24:20 -08:00
sram.c ARM: OMAP: SRAM: resolve sparse warnings 2013-01-01 15:42:00 -07:00