OMAP: wait for pwrdm transition after clk_enable()
authorTomi Valkeinen <tomi.valkeinen@nokia.com>
Fri, 12 Dec 2008 07:48:53 +0000 (09:48 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 9 Jan 2009 11:01:49 +0000 (13:01 +0200)
commit5895f72e1551762f53e33b9c78d73f8d76b699e2
tree993379ced8f9b2408208fc82af0a31010ee14062
parent9b8808126a87e3a565dd19f9202768ff09eaf102
OMAP: wait for pwrdm transition after clk_enable()

Enabling clock in a disabled power domain causes the power domain to be
turned on. However, the power transition is not always finished when
clk_enable() returns and this randomly crashes the kernel when an
interrupt happens right after the clk_enable, and the kernel tries to
read the irq status register for that domain.

Why the irq status register is inaccessible, I don't know. Also it
doesn't seem to be related to the module being not powered up, but to
the transition itself.

The same could perhaps happen after clk_disable also, but I have not
witnessed that.

The problem affects at least dss, cam and sgx clocks.

This change waits for the transition to be finished before returning
from omap2_clkdm_clk_enable().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clockdomain.c